Moritz Petersen wrote:
> 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?

LocalTime *is* time zone independent, but you are creating the LocalTime 
using a constructor that is time zone aware (see the javadoc). To create 
a LocalTime without any time zone impact, you can use new 
LocalTime(hour, min, sec, milli);


> 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 ?

period.getMillis() returns the millisecond portion of the period. In 
this case, the hours portion is 4, the minutes portion is 0, the seconds 
portion is 0 and the milliseconds portion is also 0.

Stephen


-------------------------------------------------------------------------
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