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

Invalid default TimeZone for 'Europe/Minsk'

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 7u67
    • core-libs

      FULL PRODUCT VERSION :
      java -version
      java version "1.7.0_67"
      Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
      Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

      javac -version
      javac 1.7.0_67

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      System settings:
      Location=Belarus
      User interface language=English
      System TimeZone=(UTC+03:00) Minsk
      User environment variable JAVA_OPTS=-Duser.timezone=Europe/Minsk


      A DESCRIPTION OF THE PROBLEM :
      Invalid time and timezone displayed for Belarus location and Minsk timezone (UTC+03). JAVA_OPTS with -Duser.timezone=Europe/Minsk does not help.
      The latest timezone update is installed and does not help:

      D:\soft\Java Time zone update\tzupdater-1.4.9-2014i>java -jar tzupdater.jar -V
      tzupdater version 1.4.9-b01
      JRE time zone data version: tzdata2014i
      Embedded time zone data version: tzdata2014i

      D:\soft\Java Time zone update\tzupdater-1.4.9-2014i>java -jar tzupdater.jar -u
      You have the same version as the embedded one.

      I found a report for a similar bug in Java 1.6 and it is still unresolved: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8017129

      Also there is an incorrect user.country property returned by System.getProperty("user.country").

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Use display language = English
      2. Go to Control Panel -> Clock, Language, and Region -> Region and Language -> Location tab -> choose Belarus
      3. Go to Control Panel -> Clock, Language, and Region -> Region and Language -> Formats tab -> choose Format to English (United States)
      4. Set Windows setting Timezone to (UTC+03:00) Minsk
      5. Install latest timezone Windows update
      6. Install latest timezone patch for Java (tzupdater-1.4.9-2014i)
      7. Use in Java Calendar.getInstance() and enjoy


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expected Europe/Minsk timezone, Belarus country and date and time: Thu Dec 11 12:38:58 FET 2014
      ACTUAL -
      America/Bahia timezone ID
      country=US
      TimeZone=Brasilia Time or just BRT

      Here below is output for provided source code:

      java.util.GregorianCalendar[time=1418287138531,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="America/Bahia",offset=-10800000,dstSavings=0,useDaylight=false,transitions=63,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2014,MONTH=11,WEEK_OF_YEAR=50,WEEK_OF_MONTH=2,DAY_OF_MONTH=11,DAY_OF_YEAR=345,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=2,AM_PM=0,HOUR=5,HOUR_OF_DAY=5,MINUTE=38,SECOND=58,MILLISECOND=531,ZONE_OFFSET=-10800000,DST_OFFSET=0]

      Thu Dec 11 05:38:58 BRT 2014

      sun.util.calendar.ZoneInfo[id="America/Bahia",offset=-10800000,dstSavings=0,useDaylight=false,transitions=63,lastRule=null]

      Brasilia Time

      America/Bahia

      US


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      System.out.println(Calendar.getInstance());
      System.out.println(Calendar.getInstance().getTime());
      System.out.println(Calendar.getInstance().getTimeZone()); System.out.println(Calendar.getInstance().getTimeZone().getDisplayName());
      System.out.println(System.getProperty("user.timezone"));
      System.out.println(System.getProperty("user.country"));
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Using -Duser.timezone=Europe/Minsk command line argument gives expected timezone info, but user.country property is still incorrect:

      java.util.GregorianCalendar[time=1418287518895,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Europe/Minsk",offset=10800000,dstSavings=0,useDaylight=false,transitions=69,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2014,MONTH=11,WEEK_OF_YEAR=50,WEEK_OF_MONTH=2,DAY_OF_MONTH=11,DAY_OF_YEAR=345,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=2,AM_PM=0,HOUR=11,HOUR_OF_DAY=11,MINUTE=45,SECOND=18,MILLISECOND=895,ZONE_OFFSET=10800000,DST_OFFSET=0]

      Thu Dec 11 11:45:18 FET 2014

      sun.util.calendar.ZoneInfo[id="Europe/Minsk",offset=10800000,dstSavings=0,useDaylight=false,transitions=69,lastRule=null]

      Further-eastern European Time

      Europe/Minsk

      US

      Also possible use System.setProperty("user.timezone", "Europe/Minsk"), but before Calendar.getInstance() call.

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: