Stephen,

Am 23.08.2007 um 13:57 schrieb Stephen Colebourne:

>
> You should probably use the class LocalTime to hold the time if you
> don't care about the time zone.
>
> If you want to use DateTime, you can use the constructor that takes a
> DateTimeZone, and pass in DateTimeZone.UTC.

allright, that's it. With DateTimeZone.UTC new DateTime(0) is correct.

But:

                System.out.println(new LocalTime(0));

prints "01:00:00.000". Again that mysterious 1 hour? I thought that  
LocalTime is time zone independent?

Your other tip worked very well:

                DateTime start = DateTimeFormat.forPattern("dd.MM.yyyy  
HH:mm").parseDateTime("21.08.2007 14:00");
                PeriodFormatter formatter = new 
PeriodFormatterBuilder().appendHours 
().appendSeparator(":").appendMinutes().toFormatter();
                Period period = formatter.parsePeriod("4:00");
                DateTime end = start.plus(period);
                assertEquals(new DateTime(DateConverter.toMillis("21.08.2007  
18:00")), end);

But something puzzles me: why is in the example above period.getMillis 
() == 0 ?

Thank you,
Moritz

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to