Time anomaly in java virtual machine for Windows 98 and IE4

A GMT time anomaly in daylight saving may affect the results of this applet . A small test program had been written to check this anomaly at various dates of the year
Results are given for two computer configurations .
-a standard windows 98 configuration (anomaly)
-a standard windows 98 configuration with an update which suppress the anomaly.

Java Hour program description

Part 1 GMT time verification on 8 values

The program calculates the GMT time for eight times in ms (from 1-1-1970 0h as defined in java.util.Date) and compare its results (hour minute) with corresponding reference values.Theses reference values had been checked using the julian day given by The ephemerides server of the Bureau des Longitudes- Julian Day

Part 2:Verification of the linearity of the GMT time and of discontinuities in locale time or offsets

The program detects when there is a change in time zone offset or an anomaly in local time or in GMT time. 11 time data are calculated every half hour for one year. Theses data are printed if any of the following data 5 6 8 or 9 change. Data are printed before and after the modification. Data are also printed if GMT hour change when 24 hours are added to the time, and also if the local time do not follow the daylight offset (if any).

Description of outputs

1 Time in ms from 1 1 1970 (defining DateCurrent) Date DateCurrent=new Date(Time); the time increase half an hour at each step)

2 DateCurrent.toGMTString() (java.util.Date)

3 DateCurrent.toLocaleString() (java.util.Date)

4 DateCurrent.toString() (java.util.Date) (locale time)

5 DateCurrent.TimeZoneOffset() /60 (java.util.Date)


6 (DateCurrent.getTime()- Date.UTC(DateCurrent.getYear(),DateCurrent.getMonth(),
DateCurrent.getSeconds()) )/(60*60 * 1000) equivalent to (GMT-Local) (java.util.Date)

the following output use a java.util.GregorianCalendar and a java.text.DateFormat set for local times to a time zone java.util.TimeZone.getDefault() and for the GMT times to a time zone java.util.TimeZone.getTimeZone("GMT")

7 get(Calendar.ZONE_OFFSET) for local calendar


8 get(Calendar.DST_OFFSET) for local calendar


9 get(Calendar.HOUR_OF_DAY)+get(Calendar.MINUTE)/60 for local calendar - get(Calendar.HOUR_OF_DAY)-get(Calendar.MINUTE)/60 for GMT calendar : equivalent to (Local-GMT)

10 GMT time (GMT calendar)

11 Local time (local calendar)

Results obtained on standard Windows 98

there are anomalies : GMT time is one hour in advance in daylight saving time for the four time zones tested, but the local time follow correctly DST_OFFSET

Results obtained on Windows 98 updated (with the Java Virtual Machine 2924)

Results are correct

Test your Window 98 configuration

you can read in the results GMT offset, daylight saving offset, dates of daylight saving effectively used by your computer theses data must correspond to your legal time zone
Download Hour.class and execute it using jview or java, or download and execute Hour.exe . The program writes its results in a file hour.txt created in the same directory (no other modification on hard drive).