From 30 September 2007, daylight savings time in New Zealand will be extended by 3 weeks. Clocks will go forward a week earlier than normal, and back 2 weeks later than normal.
Impact on Java Applications
The Java Virtual Machine (JVM) maintains its own implementation of time zone information and DST rules independently of the operating system's time zone database. Failure to update the DST rules will cause the JVM to make the DST change at the wrong point in time, either sooner or later than expected, potentially resulting in the JVM using the incorrect time. Potential effects range from incorrect log timestamp entries toentire application failure. See this JavaWorld article for more details.
Web services that incorporate timestamps in WS-Security headers are particularly vulnerable, since incorrect timestamps may cause SOAP messages to be rejected as "stale".
The JodaTime library maintains its own timezone database, independently of the operating system and the JVM. If your application is using this library, failure to update its timezone database may cause issues.
Do I need to update?
IBM provide the following guidance on Java DST updates:
- If your Java applications do not perform time and date processing, you do not need to update.
- If it is not important for your applications to function correctly on the affected dates, you do not need to update.
- Evaluate the risks to your business and your customers of these calculations having incorrect times. If these risks are acceptable, you do not need to update.
Update Process
The Olson timezone database is widely used as the canonical source of timezone information and DST rules. Version tzdata2007f of the Olson database contains the NZ DST changes.
Operating System
Refer to your operating system vendor for guidance on how to upgrade your operating system.
Warnings regarding Microsoft Windows updates
- If updating Windows, ensure that you do not use the timezone.exe utility from the Windows Resource Kit. For more details, see here and here.
- If updating the Windows Registry directly (see method 2 on this page), steps 7 & 8 are crucial. Failure to apply these steps correctly can result in your Java applications being up to 1 day out effective immediately. (For instance the default timezone in Sun Java 6 gets set to America / Rio Branco and the current time is 17 hours behind. In IBM 1.4.2 the timezone gets set to GMT and is 12 hours behind). It is not enough to check that the "Automatically adjust clock for daylight saving changes" is already checked. If it is already checked, you should uncheck it, recheck it, press Apply and press OK. This is required to cause the registry entries under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation to be updated.
Sun JRE/JDK
Sun provides a TZUpdater tool to update Java Runtime Environment (JRE) and Java Development Kit (JDK) installations. Version 1.2.1 of this tool incorporates the required tzdata2007f updates.
The options for each Sun Java version are:
| Description | Action required |
|---|---|
| Java 6 update 2 | None, already contains the Olson 2007f updates. |
| Java 6 update 1 or earlier | Update to Java 6 Update 2, or patch using the TZUpdater tool. |
| Java 5 | Patch using the TZUpdater tool (there is no release available that contains the Olson 2007f updates). |
| Java 1.4.2 update 15 | None, already contains the Olson 2007f updates. |
| Java 1.4.2 update 14 or earlier | Update to Java 1.4.2 Update 15, or patch using the TZUpdater tool. |
| Java 1.3.1 | If you have a Sun support contract, a specialized version of TZupdater is available to patch 1.3.1. Otherwise, update the JRE/JDK to 1.4.2 or later. |
| Java 1.2.2 | Update to a later version of JRE/JDK. |
For the latest details, see Timezone Data Versions in the JRE Software
IBM JRE/JDK
IBM provide guidance on updating IBM SDKs and JREs.
The Time Zone Update Utility for Java updates installed IBM SDKs and JREs.
Information about DST fixes in IBM JDK/JRE service releases is available here.
BEA JRockit JRE/JDK
BEA JRockit relies on similar update mechanisms to the Sun JVM. See here.
BEA clients will have access to these patches under the support agreements. Customers running BEA Guardian will automatically receive notification of this and other potential support issues.
JodaTime
If your application is using the JodaTime library, see here for information on updating the DST rules for JodaTime.
Middleware
Refer to your middleware vendor for guidance on how to upgrade your middleware.
Detecting JREs and JDKs
IBM's Time Zone Update Utility for Java can be used to detect all JRE/JDK instances on a system, both IBM and non-IBM.
Testing JRE/JDK updates
IBM provide a TimeTest test case. While this test case doesn't include the NZ DST changes, it does include source files allowing you to add the NZ DST tests yourself.
The values to use for the NZ DST changes are a timezone of "Pacific/Auckland", forward time of 1191074400000L and back time of 1207404000000L.
Alternative solutions
If all else fails, move to Greenwich
Feedback
If you have any corrections, updates or other feedback on updating Java applications for the NZ DST changes, please email me (Nigel Charman).Disclaimer: While every effort has been made to ensure that the content is factually correct, we cannot accept any responsibility for omissions or errors. Please check with your Java vendor, and test, test, test!


