<i18n dev> Integrated: 8364752: java.time.Instant should be able to parse ISO 8601 offsets of the form HH:mm:ss

Naoto Sato naoto at openjdk.org
Tue Aug 26 21:54:46 UTC 2025


On Fri, 8 Aug 2025 22:37:36 GMT, Naoto Sato <naoto at openjdk.org> wrote:

> `Instant.parse()` is expected to use the offset zone pattern `+HH:mm:ss` (as defined by `DateTimeFormatterBuilder.appendOffsetId()`), but it fails to parse hour-only offsets such as `+02`. This is because the actual implementation uses `+HH:MM:ss` as the pattern. While replacing the pattern in the implementation as with the specification would allow hour-only offsets, it would also introduce compatibility issues, i.e., printing would omit the minutes field when it is zero. So, it is preferable to update the specification to match the implementation. A CSR has also been drafted for this change.

This pull request has now been integrated.

Changeset: 1ff73cb2
Author:    Naoto Sato <naoto at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/1ff73cb2ec41612d316921e852f29e7fa4dc9109
Stats:     71 lines in 3 files changed: 62 ins; 0 del; 9 mod

8364752: java.time.Instant should be able to parse ISO 8601 offsets of the form HH:mm:ss

Reviewed-by: rriggs, vyazici, scolebourne

-------------

PR: https://git.openjdk.org/jdk/pull/26708


More information about the i18n-dev mailing list