[threeten-dev] Midnight at the end of day

Stephen Colebourne scolebourne at joda.org
Wed Nov 13 03:19:23 PST 2013


The excess day records information that would otherwise be lost. In
the LocalDateTime the information was not lost.
You will probably need to parse the date and time separately to get it to work.
Stephen


On 13 November 2013 11:14, Rosczak, Jan <Jan.Rosczak at hlag.com> wrote:
> Hello,
>
> thanks for the quick answer. That partly solves my problem, but still for a value of "2012-12-03T24:00" after parsing I do not know if "2012-12-04T00:00" or "2012-12-03T24:00" was meant, which makes a difference for us. Why don't I get an excess day in that case too?
>
> Thanks
> Jan
>
> -----Original Message-----
> From: jodastephen at gmail.com [mailto:jodastephen at gmail.com] On Behalf Of Stephen Colebourne
> Sent: Wednesday, November 13, 2013 12:06 PM
> To: Rosczak, Jan
> Subject: Re: [threeten-dev] Midnight at the end of day
>
> 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