[threeten-dev] Midnight at the end of day
Stephen Colebourne
scolebourne at joda.org
Wed Nov 13 03:06:39 PST 2013
There is no class in JDK8 that will support holding 24:00. You can
create your own implementing TemporalAccessor or Temporal if you want
one. (ISO-8601 is a data interchange format, whereas the classes aim
to be clearly defined)
The parsing mechanism does support parsing 24:00. See
http://download.java.net/jdk8/docs/api/java/time/format/DateTimeFormatter.html#parsedExcessDays--
Similarly, formatting will output any value, so if HOUR_OF_DAY returns
24, then that is what will be output.
Stephen
On 13 November 2013 07:02, Rosczak, Jan <Jan.Rosczak at hlag.com> wrote:
> Hello,
>
> we are planning to use Java 8 in one of our projects when it will be released next year. We are especially looking forward to the new Date Time API. There is one issue so, I know it maybe have been asked before, but I could not find anything recent on that topic. So here it goes.
>
> In our company we have the requirement to have a date and time that represent midnight at the end of day, not at the start of the next day, so something like 2013-11-12T24:00. The ISO 8601 norm says that for the field hour, the valid values are 00-24, where 24 is only used to denote midnight at the end of a calendar day.
>
> I hoped I could express this somehow with the new Date Time API, but was not able to find a solution, because the valid range for the hour field is 00-23. Is there something I can do or do I have to implement may one Time class?
>
> Thanks and regards
> Jan Rosczak
>
More information about the threeten-dev
mailing list