RFR: 8337712: Wrong javadoc in java.util.Date#toString(): "61" and right parenthesis

Per Minborg pminborg at openjdk.org
Fri Aug 2 07:27:07 UTC 2024


On Fri, 2 Aug 2024 07:20:39 GMT, Per Minborg <pminborg at openjdk.org> wrote:

> This trivial PR proposes to add a missing parenthesis in `java.util.Date::toString`.

src/java.base/share/classes/java/util/Date.java line 1015:

> 1013:      *     {@code 59}), as two decimal digits.
> 1014:      * <li>{@code ss} is the second within the minute ({@code 00} through
> 1015:      *     {@code 61}), as two decimal digits.

The doc mentions seconds could be in the range [0, 61]. The normal interval should be [0, 59] but maybe there are situations where leap seconds are inserted (see https://en.wikipedia.org/wiki/Leap_second). Historically, only one second has been used so I wonder why it says "61"?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20439#discussion_r1701412451


More information about the core-libs-dev mailing list