I'd like to thank our Java vendors (yes all of them) for the time.
Those who have spent the last three months updating Java to fix the DST issue have to start over and update them all once again. As we upgraded your Java installations or were running tzupdater -u for the last several months, we were fixing one problem and introducing another.
Details on the both how to see if you are affected and how to fix it are later in this article, but I'm going to start out with a rant.
The daylight savings time change as mandated by the 2005 Energy Policy Act has been nothing short of a fiasco when it comes to how our vendors reacted to them. The updates came very slow for Java products - in some cases so slow that versions of Java went out of support between the law's enactment and the patches being released. Updates for Java to reflect the DST change for 2007 were still happening *in* 2007.
Though the bug that really takes the cake is this one:
Sun BugID 6466476
Sun BugID 6530336
This was discovered less than a week before the 03/11 DST change. The official announcement came from Sun on 03/08. So our vendors had 2 years to prepare valid versions of Java for this change and we received just a 3 day window to patch for it.
What is that problem? Java programs that parse date formats which include the 3-character timezone may produce inaccurate time when working with EST (Eastern), MST (Mountain) and HST (Hawaiian) timezones.
All versions of Java from 1.4 and beyond using a new recent tzdata are impacted by this problem. This includes Java provided by Sun, IBM, BEA and HP.
There are two solutions. You can either remove the HST, EST and MST files from the "zi" directory, or you can run the tzupdater with the obscure "-bc" option meant for "Java 1.1 compatibility". (As it turns out, the "-bc" option shouldn't be optional at all.) IBM has released a new version of jtzu on Friday to address this issue for IBM java as well.
The Sun alert mentions that only tzdata versions 2006r and above are affected, but testing has shown that even earlier versions are impacted as well.
This code has been making it's way around the internet as a method to test if you are impacted. I'm not sure who submitted this code, but I'd like to thank them for finding the bug and providing the test code.
After compiling this code, use it to test your Java as follows:
java -Duser.timezone=America/New_York Moh
Wed Jun 06 14:00:00 EDT 2007
Those impacted by this bug will see:
java -Duser.timezone=America/Los_Angeles Moh
Wed Jun 06 12:00:00 PDT 2007
Those not impacted will see:
java -Duser.timezone=America/Los_Angeles Moh
Wed Jun 06 11:00:00 PDT 2007
-------------------CUT HERE-----------------
import java.text.*;
import java.util.*;
public class Moh {
public static void main(String[] args) throws Exception {
SimpleDateFormat timestampFormatWithZone = new SimpleDateFormat("yyyy-MM-dd HH:mm zzz");
Date date = timestampFormatWithZone.parse("2007-06-06 14:00 EDT");
System.out.println(date);
}
}
-------------------CUT HERE-----------------
Posted by: BrianHayward · 10 Mar 2007 · 10:59:09