# HG changeset patch # User naoto # Date 1561054914 25200 # Node ID 1aae575eb1ef9f99173d2ea6f6ba00d4f6f31752 # Parent a7b9d6d4940e72a096447fa44bf75c0ede4dffd7 8220229: Timezone pattern "OOOO" does not result in the full "GMT+00:00" substring Reviewed-by: lancea, rriggs diff -r a7b9d6d4940e -r 1aae575eb1ef src/java.base/share/classes/java/time/format/DateTimeFormatter.java --- a/src/java.base/share/classes/java/time/format/DateTimeFormatter.java Thu Jun 20 09:35:41 2019 -0700 +++ b/src/java.base/share/classes/java/time/format/DateTimeFormatter.java Thu Jun 20 11:21:54 2019 -0700 @@ -396,15 +396,16 @@ * 'Z' when the offset to be output would be zero, whereas pattern letter 'x' * (lower case) will output '+00', '+0000', or '+00:00'. *

- * Offset O: This formats the localized offset based on the number of - * pattern letters. One letter outputs the {@linkplain TextStyle#SHORT short} - * form of the localized offset, which is localized offset text, such as 'GMT', - * with hour without leading zero, optional 2-digit minute and second if - * non-zero, and colon, for example 'GMT+8'. Four letters outputs the - * {@linkplain TextStyle#FULL full} form, which is localized offset text, - * such as 'GMT, with 2-digit hour and minute field, optional second field - * if non-zero, and colon, for example 'GMT+08:00'. Any other count of letters - * throws {@code IllegalArgumentException}. + * Offset O: With a non-zero offset, this formats the localized offset + * based on the number of pattern letters. One letter outputs the + * {@linkplain TextStyle#SHORT short} form of the localized offset, which is + * localized offset text, such as 'GMT', with hour without leading zero, optional + * 2-digit minute and second if non-zero, and colon, for example 'GMT+8'. Four + * letters outputs the {@linkplain TextStyle#FULL full} form, which is localized + * offset text, such as 'GMT, with 2-digit hour and minute field, optional second + * field if non-zero, and colon, for example 'GMT+08:00'. If the offset is zero, + * only localized text is output. Any other count of letters throws + * {@code IllegalArgumentException}. *

* Offset Z: This formats the offset based on the number of pattern * letters. One, two or three letters outputs the hour and minute, without a