An unexpected adjustment to the hour occurs when creating a DateTime with all
of the following conditions:
· date is beginning or end of DST (e.g. 3/11/2007 or 10/29/2006)
· time is between 11pm and midnight
· using LenientChronology
· using a time zone created from an ID
int hour = 23;
DateTime dt;
dt = new DateTime(2006, 10, 29, hour, 0, 0, 0,
ISOChronology.getInstance(DateTimeZone.forID("America/Los_Angeles")));
assertEquals(hour, dt.getHourOfDay()); // OK – no LenientChronology
dt = new DateTime(2006, 10, 29, hour, 0, 0, 0,
LenientChronology.getInstance(ISOChronology.getInstance(DateTimeZone.forOffsetHours(-8))));
assertEquals(hour, dt.getHourOfDay()); // OK – no TZ ID
dt = new DateTime(2006, 10, 29, hour, 0, 0, 0,
LenientChronology.getInstance(ISOChronology.getInstance(DateTimeZone.forID("America/Los_Angeles"))));
assertEquals(hour, dt.getHourOfDay()); // FAILS
Bug? Or am I missing something?
(joda-time 1.4)
Regards,
Blair Martin-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest