Before the start of time-zones, Joda-Time uses the local mean time (as
defined by the timezone database). The JDK doesn't. This results in
the unusual 2 minute difference.

Stephen

On 3 June 2010 18:11, Mark McLaren <mark.mcla...@gmail.com> wrote:
> Hi all,
>
> I noticed a curious behaviour when Oracle passed me a date in the year
> "0000" from which I only wanted the time.  The odd thing is the time
> seems to lose two minutes when translated to a Joda DateTime.  I can
> replicate the issue in pure Java.
>
> What is going on here? (e.g. 10:50 becomes 10:48??)
>
> GregorianCalendar c = new GregorianCalendar(0000,0,1,10,50);
> System.out.println(c.getTime());
> DateTime d = new DateTime(c);
> System.out.println(d);
> DateTimeFormatter timeformatter = DateTimeFormat.forPattern("k:mm");
> System.out.println(timeformatter.print(d));
>
> produces:
>
> Thu Jan 01 10:50:00 GMT 1
> -0001-01-01T10:48:45.000-00:01:15
> 10:48
>
> Many thanks,
>
> Mark
>
> --
> "Paradoxically, the more time saving abstractions you are using the
> more you actually have to know." - Simon Willison
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Joda-interest mailing list
> Joda-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/joda-interest
>

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Joda-interest mailing list
Joda-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to