On Wed, 2006-03-15 at 12:29 +0100, Stéphan Mestach wrote:
> hello,
> 
> I'm struggling with timezone and chronology... does somebody can help
> me please ?
> 
> what's wrong with this code ?
> 
>       public void testDateWar() {
>               DateTimeZone.setDefault(DateTimeZone.forID("Europe/Brussels"));
>               System.out.println(" "+DateTimeZone.getDefault());
>               int year= 1914;
>               int month= 11;
>               int day= 8;
>               DateMidnight dm = new DateMidnight(year,month ,day);
>       }
> 
> I'm using jodatime 1.2.1 on a ibm jdk 1.4.2 and I've got always an exception :
> 
> java.lang.IllegalArgumentException: Illegal instant due to time zone
> offset transition: 1914-11-08T00:00:00.000

This might be a subtle problem of the definition of this historic
transition.  To experiment, I'd try to make a 11:59:59 and a 12:01 and
1:01 and see which ones it takes. Then I'd figure out if there any
missing moments. 

To check the sequence of millisecond values, I'd create times from right
before to right after the start of day value and write a unit test to
show that every millisecond value right around this time is acceptable.
At the same time, I'd format those values.  This would allow you to
checkout what the combination of the Olsen database and Joda time is
claiming are the names of each of the hours of that day.  It may be that
11:59:59 PM is followed by 1:00:00 AM, which makes new DateMidnight()
difficult to use for all cases.

If the transition is defined right (which might be a question for the
guys who try to maintain the Olsen DB), then the question is COULD
DateMidnight() be changed to handle setting to the zeroth millisecond of
the day regardless of the TZ transition?

-Paul




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to