On Mon, 18 Aug 2025 18:12:38 GMT, Roger Riggs <rri...@openjdk.org> wrote:
>> Naoto Sato has updated the pull request incrementally with one additional >> commit since the last revision: >> >> copyright year update > > src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java > line 3893: > >> 3891: .appendFraction(NANO_OF_SECOND, minDigits, >> maxDigits, true) >> 3892: .parseLenient() >> 3893: .appendOffset("+HH", "Z") > > The "+HH" pattern is supposed to be ignoring minutes and seconds but it does > not appear to. In jshell, I see: > > jshell> Instant.parse("2017-01-01T00:00:00.000-02:10:12") > $8 ==> 2017-01-01T02:10:12Z > > It would be more consistent with the original pattern to use `"+HH:mm:ss"` 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. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26708#discussion_r2283235663