ZonedDateTime class fails to parse ISO 8601 strings with short time zone offset. #345

basil-bourque opened this Issue Jan 18, 2014 · 3 comments


None yet
2 participants

According to both the Wikipedia page on ISO 8601
and RFC 3339:
…the ISO 8601 standard permits short time zone offsets such as "-01" in place of the longer "-01:00".

The documentation for ZonedDateTime.parse method claims to handle ISO 8601 strings. But these short time zone offsets fail to parse. An exception is thrown.

This line of source code succeeds…

ZonedDateTime zonedDateTime = ZonedDateTime.parse( "2014-01-17T16:45:30.528-01:00" );

This fails… (note the missing ":00" at the end)

ZonedDateTime zonedDateTime = ZonedDateTime.parse( "2014-01-17T16:45:30.528-01" );

In Java 8 Build b123 on Mac OS X Mavericks 10.9.1, that failing line throws:

java.time.format.DateTimeParseException: Text '2014-01-17T16:45:30.528-01' could not be parsed at index 23

Yesterday, I filed this issue as Bug Id: 9009717 on the Java Bug Database at I'm not sure if that was the correct place, so I filed the same issue here in the ticket.

I would have looked at the "parse" method source code myself, but I do not know how to obtain the Java 8 early release source code.


RogerRiggs commented Jan 18, 2014

The source code can be found on OpenJDK; The mercurial repository is:


RogerRiggs commented Jan 18, 2014

The corresponding JDK Bug is:


RogerRiggs commented Jan 21, 2014

See OpenJDK issue 8032051 for fix in future update.

RogerRiggs closed this Jan 21, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment