From cc97f130ff1c03bd78719733a0c1e3a577a4931b Mon Sep 17 00:00:00 2001 From: Yoshito Umaoka Date: Tue, 23 Sep 2025 06:22:06 +0000 Subject: [PATCH] ICU-23157 Do not use GMT Zero Format See #3657 --- icu4c/source/i18n/tzfmt.cpp | 5 --- icu4c/source/test/intltest/dtfmttst.cpp | 30 +++++++++--------- icu4c/source/test/intltest/dtptngts.cpp | 2 +- icu4c/source/test/intltest/tzfmttst.cpp | 10 +----- icu4c/source/test/testdata/format.txt | 2 +- .../icu/dev/test/format/DateFormatTest.java | 26 +++++++-------- .../dev/test/format/TimeZoneFormatTest.java | 4 +-- .../java/com/ibm/icu/text/TimeZoneFormat.java | 4 --- .../test/format/DateTimeGeneratorTest.java | 2 +- .../com/ibm/icu/dev/data/testdata/format.res | Bin 5440 -> 5440 bytes 10 files changed, 33 insertions(+), 52 deletions(-) diff --git a/icu4c/source/i18n/tzfmt.cpp b/icu4c/source/i18n/tzfmt.cpp index 0fb6336b86de..aaec9f31c42e 100644 --- a/icu4c/source/i18n/tzfmt.cpp +++ b/icu4c/source/i18n/tzfmt.cpp @@ -1559,11 +1559,6 @@ TimeZoneFormat::formatOffsetLocalizedGMT(int32_t offset, UBool isShort, UnicodeS return result; } - if (offset == 0) { - result.setTo(fGMTZeroFormat); - return result; - } - UBool positive = true; if (offset < 0) { offset = -offset; diff --git a/icu4c/source/test/intltest/dtfmttst.cpp b/icu4c/source/test/intltest/dtfmttst.cpp index fcea3949ab6f..f7812f4ac58f 100644 --- a/icu4c/source/test/intltest/dtfmttst.cpp +++ b/icu4c/source/test/intltest/dtfmttst.cpp @@ -2746,7 +2746,7 @@ void DateFormatTest::TestTimeZoneDisplayName() { "en", "Australia/Sydney", "2004-07-15T00:00:00Z", "VVVV", "Sydney Time", "Australia/Sydney" }, { "en", "Europe/London", "2004-01-15T00:00:00Z", "Z", "+0000", "+0:00" }, - { "en", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT", "+0:00" }, + { "en", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+00:00", "+0:00" }, { "en", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT", "+0:00" }, { "en", "Europe/London", "2004-01-15T00:00:00Z", "zzzz", "Greenwich Mean Time", "+0:00" }, { "en", "Europe/London", "2004-07-15T00:00:00Z", "Z", "+0100", "+1:00" }, @@ -2857,8 +2857,8 @@ void DateFormatTest::TestTimeZoneDisplayName() { "de", "Australia/Sydney", "2004-07-15T00:00:00Z", "vvvv", "Ostaustralische Zeit", "Australia/Sydney" }, { "de", "Europe/London", "2004-01-15T00:00:00Z", "Z", "+0000", "+0:00" }, - { "de", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT", "+0:00" }, - { "de", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT", "+0:00" }, + { "de", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+00:00", "+0:00" }, + { "de", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT+0", "+0:00" }, { "de", "Europe/London", "2004-01-15T00:00:00Z", "zzzz", "Mittlere Greenwich-Zeit", "+0:00" }, { "de", "Europe/London", "2004-07-15T00:00:00Z", "Z", "+0100", "+1:00" }, { "de", "Europe/London", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+01:00", "+1:00" }, @@ -2961,10 +2961,10 @@ void DateFormatTest::TestTimeZoneDisplayName() { "zh", "Australia/Sydney", "2004-07-15T00:00:00Z", "vvvv", "\\u6fb3\\u5927\\u5229\\u4e9a\\u4e1c\\u90e8\\u65f6\\u95f4", "Australia/Sydney" }, { "zh", "Europe/London", "2004-01-15T00:00:00Z", "Z", "+0000", "+0:00" }, - { "zh", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT", "+0:00" }, - { "zh", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT", "+0:00" }, - { "zh", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT", "+0:00" }, - { "zh", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT", "+0:00" }, + { "zh", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+00:00", "+0:00" }, + { "zh", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT+0", "+0:00" }, + { "zh", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+00:00", "+0:00" }, + { "zh", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT+0", "+0:00" }, { "zh", "Europe/London", "2004-01-15T00:00:00Z", "zzzz", "\\u683C\\u6797\\u5C3C\\u6CBB\\u6807\\u51C6\\u65F6\\u95F4", "+0:00" }, { "zh", "Europe/London", "2004-07-15T00:00:00Z", "Z", "+0100", "+1:00" }, { "zh", "Europe/London", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+01:00", "+1:00" }, @@ -3066,8 +3066,8 @@ void DateFormatTest::TestTimeZoneDisplayName() { "hi", "Australia/Sydney", "2004-07-15T00:00:00Z", "vvvv", "\\u092a\\u0942\\u0930\\u094d\\u0935\\u0940 \\u0911\\u0938\\u094d\\u091f\\u094d\\u0930\\u0947\\u0932\\u093f\\u092f\\u093e \\u0938\\u092e\\u092f", "Australia/Sydney" }, { "hi", "Europe/London", "2004-01-15T00:00:00Z", "Z", "+0000", "+0:00" }, - { "hi", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT", "+0:00" }, - { "hi", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT", "+0:00" }, + { "hi", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+00:00", "+0:00" }, + { "hi", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT+0", "+0:00" }, { "hi", "Europe/London", "2004-01-15T00:00:00Z", "zzzz", "\\u0917\\u094d\\u0930\\u0940\\u0928\\u0935\\u093f\\u091a \\u092e\\u0940\\u0928 \\u091f\\u093e\\u0907\\u092e", "+0:00" }, { "hi", "Europe/London", "2004-07-15T00:00:00Z", "Z", "+0100", "+1:00" }, { "hi", "Europe/London", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+01:00", "+1:00" }, @@ -3170,8 +3170,8 @@ void DateFormatTest::TestTimeZoneDisplayName() { "bg", "Australia/Sydney", "2004-07-15T00:00:00Z", "vvvv", "\\u0418\\u0437\\u0442\\u043E\\u0447\\u043D\\u043E\\u0430\\u0432\\u0441\\u0442\\u0440\\u0430\\u043B\\u0438\\u0439\\u0441\\u043A\\u043E \\u0432\\u0440\\u0435\\u043C\\u0435", "Australia/Sydney" }, { "bg", "Europe/London", "2004-01-15T00:00:00Z", "Z", "+0000", "+0:00" }, - { "bg", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "\\u0413\\u0440\\u0438\\u043D\\u0443\\u0438\\u0447", "+0:00" }, - { "bg", "Europe/London", "2004-01-15T00:00:00Z", "z", "\\u0413\\u0440\\u0438\\u043D\\u0443\\u0438\\u0447", "+0:00" }, + { "bg", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "\\u0413\\u0440\\u0438\\u043D\\u0443\\u0438\\u0447+00:00", "+0:00" }, + { "bg", "Europe/London", "2004-01-15T00:00:00Z", "z", "\\u0413\\u0440\\u0438\\u043D\\u0443\\u0438\\u0447+0", "+0:00" }, { "bg", "Europe/London", "2004-01-15T00:00:00Z", "zzzz", "\\u0421\\u0440\\u0435\\u0434\\u043d\\u043e \\u0433\\u0440\\u0438\\u043d\\u0443\\u0438\\u0447\\u043a\\u043e \\u0432\\u0440\\u0435\\u043c\\u0435", "+0:00" }, { "bg", "Europe/London", "2004-07-15T00:00:00Z", "Z", "+0100", "+1:00" }, { "bg", "Europe/London", "2004-07-15T00:00:00Z", "ZZZZ", "\\u0413\\u0440\\u0438\\u043D\\u0443\\u0438\\u0447+01:00", "+1:00" }, @@ -3275,8 +3275,8 @@ void DateFormatTest::TestTimeZoneDisplayName() { "ja", "Australia/Sydney", "2004-07-15T00:00:00Z", "vvvv", "\\u30AA\\u30FC\\u30B9\\u30C8\\u30E9\\u30EA\\u30A2\\u6771\\u90E8\\u6642\\u9593", "Australia/Sydney" }, { "ja", "Europe/London", "2004-01-15T00:00:00Z", "Z", "+0000", "+0:00" }, - { "ja", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT", "+0:00" }, - { "ja", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT", "+0:00" }, + { "ja", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+00:00", "+0:00" }, + { "ja", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT+0", "+0:00" }, { "ja", "Europe/London", "2004-01-15T00:00:00Z", "zzzz", "\\u30B0\\u30EA\\u30CB\\u30C3\\u30B8\\u6A19\\u6E96\\u6642", "+0:00" }, { "ja", "Europe/London", "2004-07-15T00:00:00Z", "Z", "+0100", "+1:00" }, { "ja", "Europe/London", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+01:00", "+1:00" }, @@ -3378,8 +3378,8 @@ void DateFormatTest::TestTimeZoneDisplayName() { "ti", "Australia/Sydney", "2004-07-15T00:00:00Z", "vvvv", "\\u1293\\u12ed \\u121d\\u1265\\u122b\\u1253\\u12ca \\u12a3\\u12cd\\u1235\\u1275\\u122b\\u120d\\u12eb \\u130d\\u12d8", "Australia/Sydney" }, { "ti", "Europe/London", "2004-01-15T00:00:00Z", "Z", "+0000", "+0:00" }, - { "ti", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT", "+0:00" }, - { "ti", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT", "+0:00" }, + { "ti", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+00:00", "+0:00" }, + { "ti", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT+0", "+0:00" }, { "ti", "Europe/London", "2004-01-15T00:00:00Z", "zzzz", "GMT", "+0:00" }, { "ti", "Europe/London", "2004-07-15T00:00:00Z", "Z", "+0100", "+1:00" }, { "ti", "Europe/London", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+01:00", "+1:00" }, diff --git a/icu4c/source/test/intltest/dtptngts.cpp b/icu4c/source/test/intltest/dtptngts.cpp index c6a7c2b966fd..6fb75804f53b 100644 --- a/icu4c/source/test/intltest/dtptngts.cpp +++ b/icu4c/source/test/intltest/dtptngts.cpp @@ -385,7 +385,7 @@ void IntlTestDateTimePatternGeneratorAPI::testAPI(/*char *par*/) UnicodeString(u"Thu, Oct 14, 1999, 6:58:59\u202FAM", -1), UnicodeString(u"6:58\u202FAM", -1), UnicodeString(u"6:58\u202FAM", -1), - UnicodeString(u"6:58\u202FAM GMT", -1), + UnicodeString(u"6:58\u202FAM GMT+00:00", -1), UnicodeString(""), }; diff --git a/icu4c/source/test/intltest/tzfmttst.cpp b/icu4c/source/test/intltest/tzfmttst.cpp index aa3024e6fff9..0694d5ad2019 100644 --- a/icu4c/source/test/intltest/tzfmttst.cpp +++ b/icu4c/source/test/intltest/tzfmttst.cpp @@ -181,14 +181,6 @@ TimeZoneFormatTest::TestTimeZoneRoundTrip() { )) { continue; } - UnicodeString localGMTString; - SimpleDateFormat gmtFmt(UnicodeString("ZZZZ"), LOCALES[locidx], status); - if (U_FAILURE(status)) { - dataerrln("Error creating SimpleDateFormat - %s", u_errorName(status)); - continue; - } - gmtFmt.setTimeZone(*TimeZone::getGMT()); - gmtFmt.format(0.0, localGMTString); for (int32_t patidx = 0; patidx < UPRV_LENGTHOF(PATTERNS); patidx++) { SimpleDateFormat* sdf = new SimpleDateFormat(UnicodeString(PATTERNS[patidx]), LOCALES[locidx], status); @@ -331,7 +323,7 @@ TimeZoneFormatTest::TestTimeZoneRoundTrip() { } isOffsetFormat = (numDigits > 0); } - if (isOffsetFormat || tzstr == localGMTString) { + if (isOffsetFormat) { // Localized GMT or ISO: total offset (raw + dst) must be preserved. int32_t inOffset = inRaw + inDst; int32_t outOffset = outRaw + outDst; diff --git a/icu4c/source/test/testdata/format.txt b/icu4c/source/test/testdata/format.txt index c6121a1c57d3..e3d6e72fd8b9 100644 --- a/icu4c/source/test/testdata/format.txt +++ b/icu4c/source/test/testdata/format.txt @@ -149,7 +149,7 @@ format:table(nofallback) { "GMT", "DATE=RELATIVE_FULL,TIME=LONG", "ERA=1,YEAR=2012,MONTH=OCTOBER,DATE=8,HOUR_OF_DAY=23,MINUTE=59,SECOND=0", - "segunda-feira, 8 de outubro de 2012 23:59:00 GMT" + "segunda-feira, 8 de outubro de 2012 23:59:00 GMT+0" }, // vi combined formats have time first { diff --git a/icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/DateFormatTest.java b/icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/DateFormatTest.java index 6ba0973c8341..dbe863531432 100644 --- a/icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/DateFormatTest.java +++ b/icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/DateFormatTest.java @@ -959,7 +959,7 @@ public void TestTimeZoneInLocale() { { "en", "Australia/Sydney", "2004-07-15T00:00:00Z", "VVVV", "Sydney Time", "Australia/Sydney" }, { "en", "Europe/London", "2004-01-15T00:00:00Z", "Z", "+0000", "+0:00" }, - { "en", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT", "+0:00" }, + { "en", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+00:00", "+0:00" }, { "en", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT", "+0:00" }, { "en", "Europe/London", "2004-01-15T00:00:00Z", "zzzz", "Greenwich Mean Time", "+0:00" }, { "en", "Europe/London", "2004-07-15T00:00:00Z", "Z", "+0100", "+1:00" }, @@ -1070,8 +1070,8 @@ public void TestTimeZoneInLocale() { { "de", "Australia/Sydney", "2004-07-15T00:00:00Z", "vvvv", "Ostaustralische Zeit", "Australia/Sydney" }, { "de", "Europe/London", "2004-01-15T00:00:00Z", "Z", "+0000", "+0:00" }, - { "de", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT", "+0:00" }, - { "de", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT", "+0:00" }, + { "de", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+00:00", "+0:00" }, + { "de", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT+0", "+0:00" }, { "de", "Europe/London", "2004-01-15T00:00:00Z", "zzzz", "Mittlere Greenwich-Zeit", "+0:00" }, { "de", "Europe/London", "2004-07-15T00:00:00Z", "Z", "+0100", "+1:00" }, { "de", "Europe/London", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+01:00", "+1:00" }, @@ -1174,8 +1174,8 @@ public void TestTimeZoneInLocale() { { "zh", "Australia/Sydney", "2004-07-15T00:00:00Z", "vvvv", "\u6fb3\u5927\u5229\u4e9a\u4e1c\u90e8\u65f6\u95f4", "Australia/Sydney" }, { "zh", "Europe/London", "2004-01-15T00:00:00Z", "Z", "+0000", "+0:00" }, - { "zh", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", GMT_ZH, "+0:00" }, - { "zh", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT", "+0:00" }, + { "zh", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", GMT_ZH+"+00:00", "+0:00" }, + { "zh", "Europe/London", "2004-01-15T00:00:00Z", "z", GMT_ZH+"+0", "+0:00" }, { "zh", "Europe/London", "2004-01-15T00:00:00Z", "zzzz", "\u683C\u6797\u5C3C\u6CBB\u6807\u51C6\u65F6\u95F4", "+0:00" }, { "zh", "Europe/London", "2004-07-15T00:00:00Z", "Z", "+0100", "+1:00" }, { "zh", "Europe/London", "2004-07-15T00:00:00Z", "ZZZZ", GMT_ZH+"+01:00", "+1:00" }, @@ -1277,8 +1277,8 @@ public void TestTimeZoneInLocale() { { "hi", "Australia/Sydney", "2004-07-15T00:00:00Z", "vvvv", "\u092a\u0942\u0930\u094d\u0935\u0940 \u0911\u0938\u094d\u091f\u094d\u0930\u0947\u0932\u093f\u092f\u093e \u0938\u092e\u092f", "Australia/Sydney" }, { "hi", "Europe/London", "2004-01-15T00:00:00Z", "Z", "+0000", "+0:00" }, - { "hi", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT", "+0:00" }, - { "hi", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT", "+0:00" }, + { "hi", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+00:00", "+0:00" }, + { "hi", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT+0", "+0:00" }, { "hi", "Europe/London", "2004-01-15T00:00:00Z", "zzzz", "\u0917\u094d\u0930\u0940\u0928\u0935\u093f\u091a \u092e\u0940\u0928 \u091f\u093e\u0907\u092e", "+0:00" }, { "hi", "Europe/London", "2004-07-15T00:00:00Z", "Z", "+0100", "+1:00" }, { "hi", "Europe/London", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+01:00", "+1:00" }, @@ -1381,8 +1381,8 @@ public void TestTimeZoneInLocale() { { "bg", "Australia/Sydney", "2004-07-15T00:00:00Z", "vvvv", "\u0418\u0437\u0442\u043E\u0447\u043D\u043E\u0430\u0432\u0441\u0442\u0440\u0430\u043B\u0438\u0439\u0441\u043A\u043E \u0432\u0440\u0435\u043C\u0435", "Australia/Sydney" }, { "bg", "Europe/London", "2004-01-15T00:00:00Z", "Z", "+0000", "+0:00" }, - { "bg", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", GMT_BG, "+0:00" }, - { "bg", "Europe/London", "2004-01-15T00:00:00Z", "z", GMT_BG, "+0:00" }, + { "bg", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", GMT_BG+"+00:00", "+0:00" }, + { "bg", "Europe/London", "2004-01-15T00:00:00Z", "z", GMT_BG+"+0", "+0:00" }, { "bg", "Europe/London", "2004-01-15T00:00:00Z", "zzzz", "\u0421\u0440\u0435\u0434\u043d\u043e \u0433\u0440\u0438\u043d\u0443\u0438\u0447\u043a\u043e \u0432\u0440\u0435\u043c\u0435", "+0:00" }, { "bg", "Europe/London", "2004-07-15T00:00:00Z", "Z", "+0100", "+1:00" }, { "bg", "Europe/London", "2004-07-15T00:00:00Z", "ZZZZ", GMT_BG+"+01:00", "+1:00" }, @@ -1488,8 +1488,8 @@ public void TestTimeZoneInLocale() { { "ja", "Australia/Sydney", "2004-07-15T00:00:00Z", "vvvv", "\u30AA\u30FC\u30B9\u30C8\u30E9\u30EA\u30A2\u6771\u90E8\u6642\u9593", "Australia/Sydney" }, { "ja", "Europe/London", "2004-01-15T00:00:00Z", "Z", "+0000", "+0:00" }, - { "ja", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT", "+0:00" }, - { "ja", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT", "+0:00" }, + { "ja", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+00:00", "+0:00" }, + { "ja", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT+0", "+0:00" }, { "ja", "Europe/London", "2004-01-15T00:00:00Z", "zzzz", "\u30B0\u30EA\u30CB\u30C3\u30B8\u6A19\u6E96\u6642", "+0:00" }, { "ja", "Europe/London", "2004-07-15T00:00:00Z", "Z", "+0100", "+1:00" }, { "ja", "Europe/London", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+01:00", "+1:00" }, @@ -1594,8 +1594,8 @@ public void TestTimeZoneInLocale() { { "ti", "Australia/Sydney", "2004-07-15T00:00:00Z", "vvvv", "\u1293\u12ed \u121d\u1265\u122b\u1253\u12ca \u12a3\u12cd\u1235\u1275\u122b\u120d\u12eb \u130d\u12d8", "Australia/Sydney" }, { "ti", "Europe/London", "2004-01-15T00:00:00Z", "Z", "+0000", "+0:00" }, - { "ti", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT", "+0:00" }, - { "ti", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT", "+0:00" }, + { "ti", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+00:00", "+0:00" }, + { "ti", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT+0", "+0:00" }, { "ti", "Europe/London", "2004-01-15T00:00:00Z", "zzzz", "GMT", "+0:00" }, { "ti", "Europe/London", "2004-07-15T00:00:00Z", "Z", "+0100", "+1:00" }, { "ti", "Europe/London", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+01:00", "+1:00" }, diff --git a/icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/TimeZoneFormatTest.java b/icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/TimeZoneFormatTest.java index e0e6bc85f37a..e08dbdcf7d5a 100644 --- a/icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/TimeZoneFormatTest.java +++ b/icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/TimeZoneFormatTest.java @@ -156,8 +156,6 @@ public void TestTimeZoneRoundTrip() { } logln("Locale: " + LOCALES[locidx].toString()); - String localGMTString = TimeZoneFormat.getInstance(LOCALES[locidx]).formatOffsetLocalizedGMT(0); - for (int patidx = 0; patidx < PATTERNS.length; patidx++) { logln(" pattern: " + PATTERNS[patidx]); SimpleDateFormat sdf = new SimpleDateFormat(PATTERNS[patidx], LOCALES[locidx]); @@ -268,7 +266,7 @@ public void TestTimeZoneRoundTrip() { isOffsetFormat = (numDigits > 0); } - if (isOffsetFormat || tzstr.equals(localGMTString)) { + if (isOffsetFormat) { // Localized GMT or ISO: total offset (raw + dst) must be preserved. int inOffset = inOffsets[0] + inOffsets[1]; int outOffset = outOffsets[0] + outOffsets[1]; diff --git a/icu4j/main/core/src/main/java/com/ibm/icu/text/TimeZoneFormat.java b/icu4j/main/core/src/main/java/com/ibm/icu/text/TimeZoneFormat.java index 0f42fc5747f3..84569828c659 100644 --- a/icu4j/main/core/src/main/java/com/ibm/icu/text/TimeZoneFormat.java +++ b/icu4j/main/core/src/main/java/com/ibm/icu/text/TimeZoneFormat.java @@ -1634,10 +1634,6 @@ public Object parseObject(String source, ParsePosition pos) { * @return the localized GMT string */ private String formatOffsetLocalizedGMT(int offset, boolean isShort) { - if (offset == 0) { - return _gmtZeroFormat; - } - StringBuilder buf = new StringBuilder(); boolean positive = true; if (offset < 0) { diff --git a/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/format/DateTimeGeneratorTest.java b/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/format/DateTimeGeneratorTest.java index 6aa82e550b41..074f96c95b25 100644 --- a/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/format/DateTimeGeneratorTest.java +++ b/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/format/DateTimeGeneratorTest.java @@ -204,7 +204,7 @@ public void TestSimple() { {"EyyyyMMMddhhmmss", "Thu, Oct 14, 1999, 6:58:59\u202FAM"}, // (fixed expected result per ticket 6872<-7180) {"hmm", "6:58\u202FAM"}, {"hhmm", "6:58\u202FAM"}, // (fixed expected result per ticket 6872<-7180) - {"hhmmVVVV", "6:58\u202FAM GMT"}, // (fixed expected result per ticket 6872<-7180) + {"hhmmVVVV", "6:58\u202FAM GMT+00:00"}, // (fixed expected result per ticket 6872<-7180) }; for (int i = 0; i < tests.length; ++i) { final String testSkeleton = tests[i][0]; diff --git a/icu4j/main/core/src/test/resources/com/ibm/icu/dev/data/testdata/format.res b/icu4j/main/core/src/test/resources/com/ibm/icu/dev/data/testdata/format.res index 7d261fb59c8cd839f61d89389fab923f0ef723ff..3eef98d14f8900d5acdfe386ad135f62999d96cf 100644 GIT binary patch delta 789 zcmZ9~U5HF!9LMqBd3ny9F-tSMu}f&Y)Uu>zakDjAkz7#Ilu~MUPoYhcvbj>TlyV_P z$Aw(Th1EDw%StZ9dRZ5C3peCtBP2;g)V3G$Jv%cO=HfH+fBw(!dCqg5nbD5Xj`Ffa znb0pj6V=-JL%*%o-|q$Xk9wcX{d(V2>@0Q8*Iqm@m9QtX!`c|$%q*FE#Tt@PQO%kyUoMAU>HQq}n%QKP-qqfN zw=OGj4i|6<5r(-0yP(89JYZqJ`jk~MiUzqD=5NuzLp?#xVLXO$Jg=>L&-}-RbuXBI zNq>@cuS*15Xne*u{K6FemgT#cg*4`2A(mnV)?gjF(2XtFh9dh}1^Ge4Lq9RMlYS2m zor*Jzck^9}!-xJ4n|N{`{ey#Ce=U5tw(;?XY!lfdWRH=ZLuNkX6F7ylIFF0CjH|eT z+qjEIWtIFV6wko5_;2w6U+^8jF}PN&Ua^SCMkE8I}2Mj z_DhN(C7Jy-@>pAvJ9B%__Jq}4tRx1D!-?!v&+;y}eK(^cR=D(@mT}HY_MF#IJk>g! z3!SjqF}<$ug(lUgP04v)tDPV8JL>%rFSHjLeKL<4eN(an>XhkS%I}r2r@7`qFLdS` zwJBLM)HiE=cdS}_)rBb)hmwb^6UBSUO>3`P6EYgmDz(U$%b|C83sYZ{{Z{Tx{d@48 z3yNLDWn9G#+~N_~8O0u=%*L#aDbPR^<#{a3@6f+b{fwN$dKyphqQ37f^Y=~rW|_~@ zpJ(4(j^Jt#&*RwM6!={^lV0M`PQEvLP znqfV}XRaDP{(snrVV3@Ap2t}apR8Z_Y*RKt_B7c%*%mVESf9ffF5nWb;2I)K;w~QG zaX~r%2}K1j@e1$o319FXzwo!9xQk_IMO*DK@vTjVX=An_qxfbH)6M^PTzwkVgeG++ giUPS6yvFZ9#>L8@T_!D?-?S%+GK!7U+!gWq2W{uCc>n+a