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

Windows set to Minsk timezone - java returns America/Bahia

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 7u76, 8u31
    • core-libs

      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 ----------

            okutsu Masayoshi Okutsu
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: