Joda time : DateTimeFormatter : beginning of a day
Posted
by bsreekanth
on Stack Overflow
See other posts from Stack Overflow
or by bsreekanth
Published on 2010-06-13T23:32:23Z
Indexed on
2010/06/13
23:42 UTC
Read the original article
Hit count: 537
jodatime
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.
© Stack Overflow or respective owner