From: <yos...@us...> - 2008-10-08 02:54:02
|
<br><font size=2 face="sans-serif">The change for Australia/Melbourne and Australia/Sydney was introduced in tzdata2007g. I tried a sample code below with ICU4J 4.0 (which contains 2008c) and I got the correct result.</font> <br> <br><font size=2 face="Courier New"> Calendar cal = Calendar.<i>getInstance</i>(TimeZone.<i>getTimeZone</i>(</font><font size=2 color=#4200ff face="Courier New">"Australia/Sydney"</font><font size=2 face="Courier New">));</font> <br><font size=2 face="Courier New"> cal.clear();</font> <br><font size=2 face="Courier New"> cal.set(2008, Calendar.</font><font size=2 color=#0021bf face="Courier New"><i>OCTOBER</i></font><font size=2 face="Courier New">, 8);</font> <br><font size=2 face="Courier New"> </font><font size=2 color=#820040 face="Courier New"><b>int</b></font><font size=2 face="Courier New"> dstOffset = cal.get(Calendar.</font><font size=2 color=#0021bf face="Courier New"><i>DST_OFFSET</i></font><font size=2 face="Courier New">);</font> <br><font size=2 face="Courier New"> System.</font><font size=2 color=#0021bf face="Courier New"><i>out</i></font><font size=2 face="Courier New">.println(dstOffset);</font> <br> <br><font size=2 face="sans-serif">The output is - </font><font size=2 face="Courier New">3600000</font><font size=2 face="sans-serif"> (ms)</font> <br> <br><font size=2 face="sans-serif">I guess either the tzdata patch was not installed properly or another "unpatched" copy of ICU4J is in your classpath. If you are using ICU4J 3.8 or later releases, I suggest you to try the code below -</font> <br> <br><font size=2 face="Courier New"> System.</font><font size=2 color=#0021bf face="Courier New"><i>out</i></font><font size=2 face="Courier New">.println(TimeZone.<i>getTZDataVersion</i>());</font> <br> <br><font size=2 face="sans-serif">If you get "2007g" or later version, it should work properly.</font> <br> <br><font size=2 face="sans-serif">-Yoshito </font> <br> <br><tt><font size=2>Mario Sammut <ma...@ph...> wrote on 10/07/2008 06:47:16 PM:<br> <br> > Hi</font></tt> <br><tt><font size=2>> </font></tt> <br><tt><font size=2>> The daylight savings offset for the following (atleast) haven’t been<br> > taken into account: </font></tt> <br><tt><font size=2>> Australia/Melbourne</font></tt> <br><tt><font size=2>> Australia/Sydney</font></tt> <br><tt><font size=2>> </font></tt> <br><tt><font size=2>> Using the icu java Calendar class with timeZone set to Melbourne or Sydney</font></tt> <br><tt><font size=2>> </font></tt> <br><tt><font size=2>> Calendar::get(Calendar.DST_OFFSET) for current date and time (today: 8th<br> > Oct 2008) is still returning a value of 0 where it should be 1.</font></tt> <br><tt><font size=2>> </font></tt> <br><tt><font size=2>> Doing some testing, the daylight savings offset doesn’t come into <br> > effect until doesn’t start until the 26th October 2008.</font></tt> <br><tt><font size=2>> But has in actual fact daylight savings in Melbourne and Sydney has <br> > already started (5th October 2008).</font></tt> <br><tt><font size=2>> </font></tt> <br><tt><font size=2>> I’ve downloaded the latest version and updated the tzdatabase using <br> > the icutzu tool with the same results.</font></tt> <br><tt><font size=2>> </font></tt> <br><tt><font size=2>> Cheers.</font></tt> <br><tt><font size=2>> </font></tt> <br><tt><font size=2>> ***************************************************************************</font></tt> <br><tt><font size=2>> CAUTION: This email message and accompanying data may contain information </font></tt> <br><tt><font size=2>> that is confidential and/or subject to legal privilege. If you are not the </font></tt> <br><tt><font size=2>> intended recipient, you are notified that any use, dissemination, </font></tt> <br><tt><font size=2>> distribution or copying of this message or data is prohibited. </font></tt> <br><tt><font size=2>> If you have received this email message in error, please notify us </font></tt> <br><tt><font size=2>> immediately and erase all copies of this message and attachments. Thank you.</font></tt> <br><tt><font size=2>> ***************************************************************************</font></tt> <br><tt><font size=2>> -------------------------------------------------------------------------<br> > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge<br> > Build the coolest Linux based applications with Moblin SDK & win great prizes<br> > Grand prize is a trip for two to an Open Source event anywhere in the world<br> > http://moblin-contest.org/redirect.php?banner_id=100&url=/<br> > _______________________________________________<br> > icu-support mailing list - icu...@li...<br> > To Un/Subscribe: https://lists.sourceforge.net/lists/listinfo/icu-support<br> </font></tt> |