JDK-8076296 : Windows set to Minsk timezone - java returns America/Bahia
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 7u76,8u31
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_8
  • CPU: x86
  • Submitted: 2015-03-30
  • Updated: 2015-04-01
  • Resolved: 2015-04-01
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.7.0_76"
Java(TM) SE Runtime Environment (build 1.7.0_76-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.76-b04, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.2.9200]
(more, unknown windows versions reported by users)

EXTRA RELEVANT SYSTEM CONFIGURATION :
Windows time zone set to Minsk

A DESCRIPTION OF THE PROBLEM :
Windows time zone is set to Minsk, but java returns America/Bahia, both for timezone and formatted time.

Tested:
        System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S").format(new Date(System.currentTimeMillis())));
        System.out.println(new GregorianCalendar().getTimeZone());

REGRESSION.  Last worked in version 8u40

ADDITIONAL REGRESSION INFORMATION: 
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) Client VM (build 25.40-b25, mixed mode, sharing)

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Set windows time zone to Minsk

Run:
        System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S").format(new Date(System.currentTimeMillis())));
        System.out.println(new GregorianCalendar().getTimeZone());

...and compare with windows clock

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The time printed by java should match windows' time
ACTUAL -
The time printed by java is 6h behind windows' time

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
        System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S").format(new Date(System.currentTimeMillis())));
        System.out.println(new GregorianCalendar().getTimeZone());
---------- END SOURCE ----------


Comments
Fixed as JDK-8060006.
01-04-2015

1) Run the attached test case (TimeZoneTest.java). 2) On a Windows 7 (64-bit) system, checked this for JDK 7u80, 8u40 8u31, 8u40, 8u60 ea b07, 9 ea b55. **************************************************************************************** 7: FAIL 7u72: FAIL 7u76: FAIL 7u80: OK 8: OK 8u11: FAIL 8u20: FAIL 8u25: FAIL 8u31: FAIL 8u40: OK 8u60 b07: OK 9ea b55: OK ****************************************************************************************** Output of the testcase with 7u76: run: 2015-03-31 04:36:51.711 sun.util.calendar.ZoneInfo[id="America/Bahia",offset=-10800000,dstSavings=0,useDaylight=false,transitions=63,lastRule=null] ********************************************************************************* Output of testcase with JDK 8u40: run: 2015-03-31 10:30:54.411 sun.util.calendar.ZoneInfo[id="Europe/Minsk",offset=10800000,dstSavings=0,useDaylight=false,transitions=69,lastRule=null] ******************************************************************************** Result: The issue is reproducible with JDK 7u76 and 8u31. However, with latest JDK versions 7u80 and 8u40 it seems fixed as the time printed by java matches Windows time for Minsk.
31-03-2015