You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Chris Means <cm...@empowergeo.com> on 2002/01/06 00:52:33 UTC

java.util.Date and time zone issues

Hi,

I've run into a little problem with time zones.

I know they're a pain in Java, and I thought I had them all solved!

I'm storing all dates in my Oracle backend in GMT.

In my Java/SOAP object I have the following code:

  static
  {
    TimeZone.setDefault (TimeZone.getTimeZone ("UTC")) ;
  }


Which should be (and appears to be) setting the default for Date objects to
be using GMT/UTC.

However, when a Date object get serialized (on the server side0, it appears
to be converted into the local time of the SOAP server, rather than
remaining in GMT.

Has anyone experienced this sort of problem?  Will I have to write my own
Date serializer to avoid this problem?

A simpler solution might be to change the SOAP server machine/OS to GMT,
however, when this goes into production, the client/customer has control
over the OS level configuration, and each client/customer may have
restrictions on OS level configuration that I won't be able to change...

Thanks.

-Chris