1

I would like to know how could I remove the timezone automatically shown in my service output.

Let me explain:

My webservice's output contains a field derived from this Simple Type:

<xs:simpleType name="tsMyDateTime">
    <xs:restriction base="xs:dateTime">
        <xs:pattern value="[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}" />
    </xs:restriction>
</xs:simpleType>

I would expect the following tsMyDateTime output format (for instance):

2026-02-25T00:00:00

But the output looks like:

2026-02-25T00:00:00.835-03:00

The original date object has the correct date and time, but I need to use Calendar (for xs:dateTime), but the timezone always appears.

I set the Calendar object by this way:

java.util.Date dateObject = (...)
calendar.setTime(dateObject);

Can someone give me suggestions?

demongolem
  • 9,474
  • 36
  • 90
  • 105
André Leitão
  • 240
  • 1
  • 3
  • 9
  • This is determined by the technology you're using to serialize the java into XML, not anything to do with the java.util.Date or java.util.Calendar. Is it jaxb? stax? homebrew? – Affe Jan 23 '13 at 19:53
  • Humm, interesting. It's jax-ws – André Leitão Jan 23 '13 at 19:54
  • http://stackoverflow.com/questions/6378227/how-to-change-programmatically-the-default-jaxb-date-serialization – Affe Jan 23 '13 at 19:59

0 Answers0