FULL PRODUCT VERSION :
ADDITIONAL OS VERSION INFORMATION :
Windows XP SP2
A DESCRIPTION OF THE PROBLEM :
For years after 2038, getOffset(long) on java.util.Timezone reports that the timezones America/Winnipeg and Canada/Central reports that DST ends one hour earlier than it actually should.
Curiously, the last rule listed in TimeZone.toString() reports the correct information for the time zones, including the correct end time rule (SimpleTimeZone.STANDARD_TIME). However, the actual instance of SimpleTimeZone used has the end time rule of WALL_TIME, accounting for the one hour discrepency.
All other timezones appear to behave correctly in this regard.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Construct a calendar or time in the last hour of DST in 2038 or a later year. Call TimeZone.getTimeZone("America/Winnipeg").getOffset(long) using that time. It will report that the offset is -6 hours, which is the standard offset, not the daylight offset.
Specifically, longs in the range 2172121200000-2172124799999 result in a return of -21600000, not -18000000.
EXPECTED VERSUS ACTUAL BEHAVIOR :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class Test
public static void main(String args)
TimeZone zz = TimeZone.getTimeZone("America/Winnipeg");
// set to two hours after midnight on 10/31/2038 (last day of DST)
// = one hour before the end of dst, which ends at 3am local wall time
Calendar cal = Calendar.getInstance(zz);
cal.set(2038, Calendar.OCTOBER, 31, 0, 0, 0);
if (zz.getOffset(cal.getTimeInMillis()) == zz.getRawOffset())
System.out.println("Daylight time is over early!");
System.out.println("Daylight time still going.");
---------- END SOURCE ----------