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

(tz) Information is not correct for the Buenos Aires time zone

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 6u10
    • core-libs

      FULL PRODUCT VERSION :
      java version "1.6.0_11"
      Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
      Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Windows 2003 Server SP2
      ver output = Microsoft Windows [Version 5.2.3790]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Windows does not have the correct time zone info in its registry even after applying the latest time zone patch (KB 951072 August 2008 cumulative time zone update for Microsoft Windows operating systems).

       I used a C++ program (source is at
       http://msdn.microsoft.com/en-us/library/system.timezone(VS.71).aspx)
       to query the OS outside of Java. The output is as follows:
         
      This example of selected TimeZone class elements generates the following
      output, which varies depending on the time zone in which it is run.

      Standard time name: Argentina Standard Time
      Daylight saving time name: Argentina Daylight Time

      Current date and time: 2008-12-03 23:04
      Daylight saving time? False
      Coordinated Universal Time: 2008-12-04 02:04
      UTC offset: -03:00:00

      Daylight saving time for year 2008:
      2008-12-28 00:00 to 2008-03-16 00:00, delta: 01:00:00
       --------------

      Which is incorrect since for that date the DST rule should be in effect.
         
      After fixing the registry via the steps outlined at this web site:
      http://blogs.technet.com/latam/archive/2007/12/27/time-zone-change-in-argentina-how-to-create-a-new-time-zone.aspx
         
      The following output is generated:

      This example of selected TimeZone class elements generates the following
      output, which varies depending on the time zone in which it is run.

      Standard time name: Argentina Standard Time
      Daylight saving time name: Argentina Daylight Time

      Current date and time: 2008-12-04 16:23
      Daylight saving time? True
      Coordinated Universal Time: 2008-12-04 18:23
      UTC offset: -02:00:00

      Daylight saving time for year 2008:
      2008-10-18 23:59 to 2008-03-16 00:00, delta: 01:00:00
       ----------------

        Which is completely correct.

      A DESCRIPTION OF THE PROBLEM :
      On a Windows 2003 Server SP2 system which is set to the Buenos Aires time zone I am seeing some incorrect time zone results.The Java version is 1.6.0_11 which has tzupdate 1.3.11 applied.

      (Note: I am submitting this bug at the request of development support for case 11335507)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Use the Adjust date/Time utility to set the system to Buenos Aires time (GMT-3).
      2. Run a Java based program to display the timezone information (see the included test program).

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The output should be:
      Java version = 1.6.0_11
      Current System Time is: Thu Dec 11 13:47:53 ARST 2008
      Current Calendar Time is: Thu Dec 11 13:47:53 ARST 2008
      Current TimeZone is : "Argentine Time": ID = America/Argentina/Buenos_Aires
      Current TimeZone.getRawOffset is: -10800000: offset in hours = -3
      Current TimeZone.getOffset is: -7200000: offset in hours = -2
      Current TimeZone.useDaylightTimeis : true

      timeZone.getTimeZone(ID) using ID = "America/Argentina/Buenos_Aires"
       returns
      sun.util.calendar.ZoneInfo[id="America/Argentina/Buenos_Aires",offset=-10800000,dstSavings=3600000,useDaylight=true,transitions=118,lastRule=java.util.SimpleTimeZone[id=Americ/Argentina/Buenos_Aires,offset=-10800000
       ,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=
      9,startDay=15,startDayOfWeek=1,startTime=0,startTimeMode=0,endMode=3,end
      Month=2,endDay=15,endDayOfWeek=1,endTime=0,endTimeMode=0]]

      ACTUAL -
      Running the program returns these results:
      Java version = 1.6.0_11
      Current System Time is : Wed Dec 10 17:22:23 VET 2008
      Current Calendar Time is : Wed Dec 10 17:22:23 VET 2008
      Current TimeZone is : "Venezuela Time": ID = America/Caracas
      Current TimeZone.getRawOffset is : -16200000: offset in hours = -4
      Current TimeZone.getOffset is : -16200000: offset in hours = -4
      Current TimeZone.useDaylightTime is : false

      timeZone.getTimeZone(ID) using ID = "America/Argentina/Buenos_Aires" returns sun.util.calendar.ZoneInfo[id="America/Argentina/Buenos_Aires",offset=-10800000,
      dstSavings=3600000,useDaylight=true,transitions=118,lastRule=java.util.SimpleTimeZone[id=America/Argentina/Buenos_Aires,offset=-10800000,dstSavings=3600000,useD
      aylight=true,startYear=0,startMode=3,startMonth=9,startDay=15,startDayOfWeek=1,startTime=0,startTimeMode=0,endMode=3,endMonth=2,endDay=15,endDayOfWeek=1,endTime =0,endTimeMode=0]]


      where the ID is incorrect as well as the offets and DST setting.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      No error messages, but incorrect information gets displayed.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.util.Date;
      import java.util.Calendar;
      import java.util.TimeZone;

      public class GetCurrentTimeZone
      {

          public static void main(String[] args)
          {
              System.out.println("Java version = "+ System.getProperty("java.version"));

              Calendar now = Calendar.getInstance();

              TimeZone timeZone = now.getTimeZone();

              System.out.println("Current System Time is: " + new Date(System.currentTimeMillis()));
              System.out.println("Current Calendar Time is: " + new Date(now.getTimeInMillis()));
              System.out.println("Current TimeZone is: \"" + timeZone.getDisplayName() + "\": ID = " + timeZone.getID());

              int offset = timeZone.getRawOffset();
              System.out.println("Current TimeZone.getRawOffset is: " + offset + ": offset in hours = "+ offset / 3600000);

              offset = timeZone.getOffset(now.getTimeInMillis());
              System.out.println("Current TimeZone.getOffset is: " + offset + ": offset in hours = "+ offset / 3600000);
              System.out.println("Current TimeZone.useDaylightTime is: " + timeZone.useDaylightTime());

              String id = "America/Argentina/Buenos_Aires";
              System.out.println("\ntimeZone.getTimeZone(ID) using ID = \""+ id + "\" returns\n" + timeZone.getTimeZone(id));
          }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      There is no workaround that I am aware of.

            okutsu Masayoshi Okutsu
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: