<i18n dev> RFR: 8364752: Class java.time.Instant cannot parse all ISO 8601 date formats [v5]

Naoto Sato naoto at openjdk.org
Mon Aug 18 22:43:39 UTC 2025


On Mon, 18 Aug 2025 22:28:45 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> IIUC, "ignoring minutes and seconds" refers to formatting, i.e, "-02:10:12" only prints "-02" Parsing offsets in lenient mode always parses minute/seconds.
>
> True, but you have to read further into the `appendOffset` prose to know that the minutes and sections can be present. Using the full pattern would convey more quickly the full syntax being parsed.

Using the full pattern means the colons may not be optional. The `appendOffset` spec reads:

If the specified pattern is "+HH", the presence of colons is determined by whether the character after the hour digits is a colon or not.

Among the supported patterns, only "+HH" (and I believe "+H" too) take the colons optional in lenient mode, i.e, both "+02:00" and "+0200" are allowed, which suits the ISO 8601 offset format.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26708#discussion_r2283644271


More information about the i18n-dev mailing list