1

I'm new to Intersystems Cache and getting the following error returning a %Timestamp property from a Web Service i'm calling through a .NET Application:

[System.FormatException] = {"The string '2012-11-22T20:00Z' is not a valid AllXsd value."}

Does anyone know how I can reformat the %Timestamp property to a European Date/Time format before returning it?

Thanks,

O.

Mansoor Siddiqui
  • 20,853
  • 10
  • 48
  • 67
user676567
  • 1,119
  • 9
  • 20
  • 39

2 Answers2

0

The code that is doing this is found in the LogicalToXSD class method of the %Library.TimeStamp class. Looking at the code, it is not intended to support different Date/Time formats.

You could change the property from being of data type TimeStamp to data type EuropeanTimeStamp, a class you create as a subclass of %Library.TimeStamp. You could then override the LogicalToXSD and XSDToLogical methods.

Obviously whatever format you use is the format all consumers of the web service will get.

You might also be able to handle this on the .NET side. If you can tell whatever is consuming the webs service that the property in question is a string then you can convert it to Date/Time later.

Marcellinov
  • 311
  • 7
  • 18
psr
  • 2,870
  • 18
  • 22
0

It looks like you're using SOAP? If so have a look at the LogicalToXSD(..) method. (And consider the parameter XMLTIMEZONE).

If you just need to convert the actual value $ZTS is your friend

kazamatzuri
  • 413
  • 1
  • 3
  • 12