8276775: ZonedDateTime/OffsetDateTime.toString return invalid ISO-8601 for years <= 1893

Reviewed-by: lancea, iris, bpb, scolebourne, rriggs
This commit is contained in:
Naoto Sato 2021-11-10 20:53:23 +00:00
parent 0c409cac78
commit bce35ac1d6
2 changed files with 7 additions and 5 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -2207,7 +2207,8 @@ public final class ZonedDateTime
* <p>
* The format consists of the {@code LocalDateTime} followed by the {@code ZoneOffset}.
* If the {@code ZoneId} is not the same as the offset, then the ID is output.
* The output is compatible with ISO-8601 if the offset and ID are the same.
* The output is compatible with ISO-8601 if the offset and ID are the same,
* and the seconds in the offset are zero.
*
* @return a string representation of this date-time, not null
*/