|
| WSAD7 / Java 1.5 reporting the wrong time after Daylight changes. |
 |
Sun, 06 Apr 2008 02:07:17 EDT |
First, if this is the wrong thread, please direct me the correct one :-)<br
/>
<br />
I work in Tel Aviv, using WSAD7 IBM Java 1.5 and sometimes Sun Java 1.5 Since
the DST change, Java reports the time as 'one hour ahead'. I get the
following;<br />
<br />
Locale.getDefault() --> iw_IL (CORRECT)<br />
new GregorianCalendar().getTime() --> now + 1 hour (WRONG)<br />
new GregorianCalendar().getTimeZone() --> Asia/Jerusalem (CORRECT)<br
/>
new GregorianCalendar().useDaylightTime() --> true (CORRECT)<br />
System.currentTimeMillis() --> now + 1 hour (WRONG)<br />
<br />
I had the same problem in Sun Java 1.5. There is a 'registry fix', if one sets
'DisableAutoDaylightSet=1', Sun Java 1.5 reports ;<br />
<br />
Locale.getDefault() --> iw_IL (CORRECT)<br />
new GregorianCalendar().getTime() --> now! (CORRECT)<br />
new GregorianCalendar().getTimeZone() --> GMT+2 (CORRECT, but not
Asia/Jerusalem!?, I don't use this anyway).<br />
new GregorianCalendar().useDaylightTime() --> false (WRONG, but our PCs
are sync'd with a central server and we don't care if this is true or
false).--> now + 1 hour (WRONG)<br />
System.currentTimeMillis() --> now! (CORRECT)<br />
<br />
This 'fix' does <b>not</b> work for IBM Java 1.5. The timezone
database is correct as it has the correct start-finish times for DST here).
<br />
<br />
|
| Post Reply
|
|
|
|
|
|
|
|
|
|