users@jaxb.java.net

xs:dateTime and Daylight Savings Offsets

From: Noah Vihinen <noah.vihinen_at_mirror-image.com>
Date: Tue, 08 Jul 2003 09:29:10 -0400

I'm either having a jaxb creation-marshaling problem or a
misunderstanding of the dateTime datatype.

I construct two java Calendar instances - one that's during daylight
savings time, and one that's not. Both are created with the
'America/New_York' timezone. When I run the getTime() methods of these
Calendar objects and output the result I get the following:

Sat Mar 15 16:35:00 EST 2003
Fri Apr 18 10:30:00 EDT 2003

Notice one is Eastern Standard Time (-5 of UTC) and the other is
Eastern Daylight Time (-4 of UTC).

I then put these Calendar objects into my JAXB data tree, and marshal
them into an XML file. In the file these dates are output as this:

2003-03-15T16:35:00-05:00
2003-04-18T10:30:00-05:00

This surprises me, as the second EDT time still shows an offset of -5,
and has not accounted for the constant offset by changing the time.

Can anyone tell me what I'm missing?

Thanks!
Noah