FULL PRODUCT VERSION :
1.4.2_11, 1.5.0_10-b03, 1.6.0-b105
ADDITIONAL OS VERSION INFORMATION :
Windows XP, Solaris 10
EXTRA RELEVANT SYSTEM CONFIGURATION :
jre 1.4.2 with DST patch ( tzupdater.jar )
A DESCRIPTION OF THE PROBLEM :
Calendar.getTime() after Calendar.setTime() does not seem to reflect the new DST change. It prints out EST where it should be EDT. This seems to happen only when user tries to use Caldenar.setTime to change the time between 1 to 2 am on Nov 4.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1a) Set the system date to 4th November 2007
1b) Set the System Clock Timezone to ( GMT -05:00 Estern Time ( us & Canada))
( Check the box : Automatically adjust the clock for DST )
2) Set tthe System Clock time to 1:30:00 am EDT
3) Run the sample program
First line of the output : it reads the time as 1:30:00 am EDT ( correct one )
Second line of the output : it prints the time as 1:30:00am EST
( Between the first output and second output , the only change i am doing is setting the time to 1:30:00 using calendar.set() function , note that i am not even changing the timezone. ).
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
cal.getTime() Sun Nov 04 01:30:48 EDT 2007
cal.getTime() Sun Nov 04 01:30:48 EDT 2007
ACTUAL -
cal.getTime() Sun Nov 04 01:30:48 EDT 2007
cal.getTime() Sun Nov 04 01:30:48 EST 2007
ERROR MESSAGES/STACK TRACES THAT OCCUR :
No error message
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.util.*;
public class d
{
public static void main(String args[])
{
Calendar cal = Calendar.getInstance(TimeZone.getDefault());
System.out.println("cal.getTime() " + cal.getTime() );
cal.set(2007, 10, 4);
System.out.println("cal.getTime() " + cal.getTime() );
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
No work around. We can't switch to some other api as this calendar api have been used at different places. and its very crucial api.