Synopsis : Change in output with Auto DST On/Off with Windows XP and Windows 2000.
Description :
We have a query from customer with Auto DST turned On/Off on Windows XP as well as on Windows 2000.
There will a behaviour change in the Date().toString() when the
'automatically adjust clock for daylight saving changes' checkbox is
unchecked on Microsoft Windows. Here is a simple test to show this
behaviour. Compiling this class and running it on Windows with and
without the 'automatically adjust clock for daylight saving changes'
checkbox found under 'Timezone' tab in the 'Date and Time properties
dialog (double click on the clock display in the system panel on the
desktop).
This issue can be seen with JDK 1.5.0_10 and 1.5.0_09.
Test Code :
------------
public class test {
public static void main(String[] args) {
System.err.println(new java.util.Date().toString());
}
}
Output :
---------
With 'Automatically adjust clock for daylight saving changes' checked
C:\>java test
Tue Feb 27 10:37:22 PST 2007
With 'Automatically adjust clock for daylight saving changes' unchecked
C:\java test
Tue Feb 27 10:37:32 GMT-08:00 2007
What customers would like to see is 'PST 2007' instead of 'GMT-08:00'
even if the 'automatically adjust clock for daylight saving changes' is
unchecked. Reason being, the TZ Geo is not changed but only the Auto DST
setting is turned off.
It would be helpful to inform any workaround/suggestion on this.