-
Bug
-
Resolution: Cannot Reproduce
-
P2
-
None
-
1.0, 1.1.1
-
generic
-
generic, solaris_2.5
The following code:
$ cat TZTest.java
import java.io.*;
import java.util.*;
public class TZTest {
TZTest() {
TimeZone time_zone = TimeZone.getDefault();
System.out.println("The current time is :" + new Date());
System.out.println("The timezone is "+time_zone.getID());
if (time_zone.inDaylightTime(new Date()))
System.out.println("in Daylight time");
else
System.out.println("not in Daylight time");
if (time_zone.useDaylightTime())
System.out.println("use Daylight time");
else
System.out.println("not use Daylight time");
System.out.println("Raw offset in seconds: "+time_zone.getRawOffset());
System.out.println("Raw offset in hours: "+
time_zone.getRawOffset()/(1000*60*60));
GregorianCalendar gc = new GregorianCalendar();
gc.setTime(new Date());
System.out.println("DST offset in seconds: "+
time_zone.getOffset(gc.AD, gc.get(gc.YEAR), gc.get(gc.MONTH),
gc.get(gc.DAY_OF_MONTH), gc.get(gc.DAY_OF_WEEK), 0));
System.out.println("DST offset in hours: "+
time_zone.getOffset(gc.AD, gc.get(gc.YEAR), gc.get(gc.MONTH),
gc.get(gc.DAY_OF_MONTH), gc.get(gc.DAY_OF_WEEK), 0)/(1000*60*60));
}
public static void main(String argv[]) {
new TZTest();
}
}
returns an incorrect value for getOffset(). DST is ignored.
$ cat TZTest.java
import java.io.*;
import java.util.*;
public class TZTest {
TZTest() {
TimeZone time_zone = TimeZone.getDefault();
System.out.println("The current time is :" + new Date());
System.out.println("The timezone is "+time_zone.getID());
if (time_zone.inDaylightTime(new Date()))
System.out.println("in Daylight time");
else
System.out.println("not in Daylight time");
if (time_zone.useDaylightTime())
System.out.println("use Daylight time");
else
System.out.println("not use Daylight time");
System.out.println("Raw offset in seconds: "+time_zone.getRawOffset());
System.out.println("Raw offset in hours: "+
time_zone.getRawOffset()/(1000*60*60));
GregorianCalendar gc = new GregorianCalendar();
gc.setTime(new Date());
System.out.println("DST offset in seconds: "+
time_zone.getOffset(gc.AD, gc.get(gc.YEAR), gc.get(gc.MONTH),
gc.get(gc.DAY_OF_MONTH), gc.get(gc.DAY_OF_WEEK), 0));
System.out.println("DST offset in hours: "+
time_zone.getOffset(gc.AD, gc.get(gc.YEAR), gc.get(gc.MONTH),
gc.get(gc.DAY_OF_MONTH), gc.get(gc.DAY_OF_WEEK), 0)/(1000*60*60));
}
public static void main(String argv[]) {
new TZTest();
}
}
returns an incorrect value for getOffset(). DST is ignored.