tags:

views:

147

answers:

1

Hello,

DateTimeFormatter fmt = DateTimeFormat.forStyle('SS').withLocale(locale) DateTime dt = fmt.parseDateTime("11/4/03 8:14 PM");

the above statement will parse the string correctly, and save as DateTime (Joda Time).

Now how to represent the beginning of a day. The below fails with DateTime dt = fmt.parseDateTime("11/4/03 00:01 AM");

Cannot parse "11/4/03 00:01 AM": Value 0 for clockhourOfHalfday must be in the range [1,12]

I'm obviously confused with the standards, like what is the short representation of the beginning of a day.

thanks.

+2  A: 

The beginning of the day is 12 AM not 00 AM, try your string with "11/4/03 12:01 AM".

krock
thanks for the hint.. I see it in http://en.wikipedia.org/wiki/12-hour_clock , it is indeed 12:00 Am ..
bsreekanth