<?xml version="1.0" encoding="ISO-8859-1"?> | |
<document> | |
<properties> | |
<title>Java date and time API - Time zone update</title> | |
<author>Stephen Colebourne</author> | |
</properties> | |
<body> | |
<section name="Time zone updates"> | |
<p> | |
Time zones are a concept driven by the political situation in each country around the world. | |
As such, they change frequently, and often at short notice. | |
In order to manage this, Joda-Time uses the internationally recognised | |
<a href="http://www.iana.org/time-zones">tz database</a>, which is also used | |
in most operating systems and the JDK itself. | |
</p> | |
<p> | |
Using JDK time zone data is a problem however, as the zones are only updated when the | |
JDK is updated. This can cause issues if you are locked into an older version of the JDK. | |
</p> | |
<p> | |
Joda-Time also compiles the time zone data into our jar file. However, the key difference is | |
that you can update the raw data and recompile the jar at any time. | |
</p> | |
</section> | |
<section name="Updating the time zone data"> | |
<p> | |
Firstly, download the latest version of the data files from | |
<a href="http://www.iana.org/time-zones">tz database</a>. | |
Ensure you select the "Data" download which comes as a tar.gz. | |
</p> | |
<p> | |
Secondly, you need a <a href="download.html">source code download</a> of Joda-Time. | |
</p> | |
<p> | |
Thirdly, you must take the time zone data files from step one, and replace those in the Joda-Time download. | |
They are located at <code>{root}/src/main/java/org/joda/time/tz/src</code>. | |
Note that only <i>some</i> of the files need to be copied across. | |
</p> | |
<p> | |
Fourthly, change the version number in the pom.xml file to indicate that it is a non-standard release. | |
</p> | |
<p> | |
Finally, recompile the Joda-Time jar file using maven. | |
Simply type <code>mvn package</code> in the root directory. | |
</p> | |
</section> | |
</body> | |
</document> |