Name: rmT116609 Date: 10/17/2000
Microsoft(R) Windows NT(TM)
(C) Copyright 1985-1996 Microsoft Corp.
H:\>java -version
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
H:\>
I am having a problem with date/times displays which is related to daylight
savings. I am extracting
dates and times from an Oracle database and then displaying them in an applet
but the displayed
times are 1 hour latter than the database data. In tracking down this anomaly I
noticed that the
system times being displayed in the logging where also out 1 hour. So to track
this down I ran the
following the following code: using jdk1.3 the output shows the time as being 1
hour latter than
the time shown on the tool bar clock (the pc's clock). The pc's time zone is
set to
Australia/Adelaide. When the same code is compiled and run under jdk1.2 it
displays the same
time as the toolbar clock.
==========================================================================
**************Source:
import java.util.*;
public class Test_DateOutput {
public static void main(String args[]) {
System.out.println("System TimeZone: " + TimeZone.getDefault ());
java.util.Date systemDate = new java.util.Date();
System.out.println("System date/time: " + systemDate.toString ());
System.out.println();
System.out.println("================================================");
System.out.println("user.timezone="+System.getProperties().getProperty
("user.timezone"));
System.out.println();
System.out.println("================================================");
System.out.println("timezone=" + TimeZone.getDefault ().toString ());
}
}
************* end of source.
==============================================================================
******* JDK1.2 - Output
C:\Test\TestDates\1_2>c:
C:\Test\TestDates\1_2>cd \Test\TestDates\1_2
C:\Test\TestDates\1_2>C:\JBuilder35\jdk1.2.2\bin\java Test_DateOutput
================================================
user.timezone=Australia/Adelaide
System TimeZone: java.util.SimpleTimeZone[id=Australia/Adelaide,offset=34200000,
dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=9,startDa
y=-1,startDayOfWeek=1,startTime=7200000,endMode=2,endMonth=2,endDay=-1,endDayOfW
eek=1,endTime=10800000]
================================================
System date/time: Wed Oct 11 14:52:32 GMT+09:30 2000
================================================================================
======
******* JDK1.3 - Output
C:\Test\TestDates\1_3>c:
C:\Test\TestDates\1_3>cd \Test\TestDates\1_3
C:\Test\TestDates\1_3>C:\jdk1.3\bin\java Test_DateOutput
================================================
user.timezone=
System TimeZone: java.util.SimpleTimeZone[id=Australia/Adelaide,offset=34200000,
dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=7,startDa
y=-1,startDayOfWeek=1,startTime=7200000,startTimeMode=1,endMode=2,endMonth=2,end
Day=-1,endDayOfWeek=1,endTime=7200000,endTimeMode=1]
================================================
System date/time: Wed Oct 11 15:52:40 GMT+10:30 2000
********* End of output.
=============================
I notice that for 1.3 the dstSavings startMonth=7 but for 1.2 its 9?
(Review ID: 110684)
======================================================================