views:

314

answers:

1

Scenario

The date format which is output as a response to the Web Service client by Axis2 is formatted as "2009-08-28+01:00". I would like to change this to show only the date without the timezone information (e.g.:"2009-08-28")

Configuration

Libraries

Axis 2 1.4.1

WSDL

<xsd:element name="StartDate" type="xsd:date" />;

Question

  • Is it possible to change the output format, wich is used by Axis 2 to write date information?
  • Can you see any issues for .NET clients reagrding the conversion of this date format?

Constraints

Unfortunately it is not possible to change the "StartDate" element to a xsd:string or xsd:token


Question refinement

As I am using the xsd:date XML Data Type which is defined as

[-]CCYY-MM-DD[Z|(+|-)hh:mm]

Thus if I set

Calendar cal = Calendar.getInstance();
cal.setTimeZone(TimeZone.getTimeZone("UTC");
...

then the output looks like this

2009-01-28Z

You can replace "UTC" by "GMT" or "".

Can I get rid of the "Z"?

+1  A: 

You can't.

Its value space is described as a combination of date and time of day in Chapter 5.4 of ISO 8601. Its lexical space is the extended format:

[-]CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm]

The time zone may be specified as Z (UTC) or (+|-)hh:mm. Time zones that aren't specified are considered undetermined.

http://books.xmlschemata.org/relaxng/ch19-77049.html

Edit:

For reference see XML Schema Part 2: Datatypes Second Edition 3.2.7 dateTime

It is in fact not dateTime what I am using, but in principle you are right (http://books.xmlschemata.org/relaxng/ch19-77041.html)
Dynamicbyte
another one:the date specification says that the TimeZone is optional.<quote>Time zones that aren't specified are considered undetermined.</quote>
Dynamicbyte