Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8252884

[java.locale.providers=CLDR] TimeZone abbreviation is not changed by Daylight saving time

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 14.0.2, 15, 16
    • core-libs
    • None

      When I specified -Djava.locale.providers=CLDR, TimeZone abbreviation is not changed even if it's in Daylight saving time.

      Attached testcase TzNameTest can detect the TimeZone setting is changed or the TimeZone is in Daylight saving time or Standard time.

      I used macOS Mojave with Japanese.
      I think this issue also happens with the other language setting.
      $ ~/jdk-16.jdk/Contents/Home/bin/java -version
      openjdk version "16-ea" 2021-03-16
      OpenJDK Runtime Environment (build 16-ea+14-589)
      OpenJDK 64-Bit Server VM (build 16-ea+14-589, mixed mode, sharing)

      ### Normally one day should be 24 hours with standard time or daylight saving time, so "25" should be invalid
      $ ~/jdk-16.jdk/Contents/Home/bin/java -Djava.locale.providers=CLDR TzNameTest.java | grep -C2 '25$'
      Africa/Cairo useDaylightTime=false
      Africa/Casablanca useDaylightTime=false
      2020 04 19 GMT 25
      2020 05 31 GMT 23
      Africa/Ceuta useDaylightTime=true
      --
      --
      Africa/Douala useDaylightTime=false
      Africa/El_Aaiun useDaylightTime=false
      2020 04 19 GMT 25
      2020 05 31 GMT 23
      Africa/Freetown useDaylightTime=false
      ### According to above output Africa/Casablanca Africa/El_Aaiun have issue
      $ ~/jdk-16.jdk/Contents/Home/bin/java -Djava.locale.providers=CLDR TzNameTest.java Africa/Casablanca Africa/El_Aaiun
      Africa/Casablanca useDaylightTime=false
      2020 04 19 GMT 25
      2020 05 31 GMT 23
      Africa/El_Aaiun useDaylightTime=false
      2020 04 19 GMT 25
      2020 05 31 GMT 23
      ### According to zdump -v Africa/Casablanca
      $ zdump -v Africa/Casablanca | grep 2020
      Africa/Casablanca Sun Apr 19 01:59:59 2020 UTC = Sun Apr 19 02:59:59 2020 +01 isdst=1
      Africa/Casablanca Sun Apr 19 02:00:00 2020 UTC = Sun Apr 19 02:00:00 2020 +00 isdst=0
      Africa/Casablanca Sun May 31 01:59:59 2020 UTC = Sun May 31 01:59:59 2020 +00 isdst=0
      Africa/Casablanca Sun May 31 02:00:00 2020 UTC = Sun May 31 03:00:00 2020 +01 isdst=1
      ### On default setting, it seems daylight saving time was ended by Apr 19, daylight saving time was started by May 31.
      ### I have a concern by useDaylightTime=false ...
      $ LANG=C ~/jdk-16.jdk/Contents/Home/bin/java TzNameTest.java Africa/Casablanca Africa/El_Aaiun
      Africa/Casablanca useDaylightTime=false
      2020 04 19 WEST 3
      2020 04 19 WET 22
      2020 05 31 WEST 21
      2020 05 31 WET 2
      Africa/El_Aaiun useDaylightTime=false
      2020 04 19 WEST 3
      2020 04 19 WET 22
      2020 05 31 WEST 21
      2020 05 31 WET 2
      # Same kind issue also happens on following command (Use user.language=en)
      $ ~/jdk-16.jdk/Contents/Home/bin/java -Duser.language=en -Dzdt.year=1949 -Djava.locale.providers=CLDR TzNameTest.java Asia/Tokyo
      Asia/Tokyo useDaylightTime=false
      1949 04 03 GMT+09:00 23
      1949 09 11 GMT+09:00 25
      ### It works fine without java.locale.providers=CLDR
      $ ~/jdk-16.jdk/Contents/Home/bin/java -Duser.language=en -Dzdt.year=1949 TzNameTest.java Asia/Tokyo
      Asia/Tokyo useDaylightTime=false
      1949 04 03 JDT 23
      1949 09 11 JDT 1
      ### Above output should be fine because of following case.
      $ zdump -v Asia/Tokyo | grep 1949
      Asia/Tokyo Sat Apr 2 14:59:59 1949 UTC = Sat Apr 2 23:59:59 1949 JST isdst=0
      Asia/Tokyo Sat Apr 2 15:00:00 1949 UTC = Sun Apr 3 01:00:00 1949 JDT isdst=1
      Asia/Tokyo Sat Sep 10 14:59:59 1949 UTC = Sun Sep 11 00:59:59 1949 JDT isdst=1
      Asia/Tokyo Sat Sep 10 15:00:00 1949 UTC = Sun Sep 11 00:00:00 1949 JST isdst=0

            naoto Naoto Sato
            itakiguchi Ichiroh Takiguchi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: