Today after DST shift one of our unit tests failed. The method under 
test no longer returned proper values.

The method takes a javax.xml.datatype.XMLGregorianCalendar, converts it 
to DateTime, and sets the time to last milli of the day i.e. 
23:59:59.999. When I checked the final value it was 
2012-10-28T23:59:59.999+02:00 which is correct apart from the +2 
(instead of +1) time zone.

When I checked the chronology of the DateTime object it said 
"GregorianChronology[+02:00]". If I manually set the chronology by 
invoking .withChronology(GregorianChronology.getInstance()) I get 
"GregorianChronology[Europe/Berlin]" and the code works as intended.

This is the code:
new DateTime(xmlCal.toGregorianCalendar()).plusDays(1).minusMillis(1);

Cheers,
Marcel

-- 
Marcel Stör, http://www.frightanic.com
Couchsurfing: http://www.couchsurfing.com/people/marcelstoer
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

------------------------------------------------------------------------------
WINDOWS 8 is here. 
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
_______________________________________________
Joda-interest mailing list
Joda-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to