Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



6 Commits

Repository files navigation


WARNING This is an old project. For new projects, one should look at better solutions, such as Joda-Time, but I'll keep this here for those that need it.


This library allows a developer or a sysadmin to force Java applications (including those hosted on Java servers such as Tomcat) to use the host operating system's timezone info (stored at /etc/localtime, using the [ tz database format]).

It was created because Sun's JVM has its own timezone info (which gets quickly outdated in countries where Daylight Saving Time changes every year, such as Brazil). Sysadmins (and some Linux distros) are used to update this information on the underlying OS, but doing the same on the JVM can be complicated and/or unfeasible.


To use the library, application developers can just call the Timefix.fizTimeZone() method on the application startup (but it makes your app OS-dependable). A better solution for OS-neutrality (and for deployers/sysadmins that have no access to the application source code) is to force the timezone change by 'injecting' the class on the application's startup script.

For example, if your startup script contains:

java param1 param2 param3

you can just add the lib to the classpath (e.g.: export CLASSPATH=$CLASSPATH:timefix-1.0.jar) and insert 'timefix' before the main class name:

java timefix param1 param2 param3

and the app will start with the correct timezone info. Whenever you change /etc/localtime, just restart the applicaiton and it will use the new info. It also works with application servers (such as Tomcat, in which you change

Included Library

The 'magic' of reading and interpreting timezone information from /etc/localtime is cast by Stuart D. Gathman's excellent Java implementation of the tz routines, which you can download at It is included in this project in compliance with LGPL, and a copy of his is included (unchanged) on the repository just as a convenience for builders - you should check his page for other uses (and to see lots of interesting code too).


Injects timezone info from a (Unix-like) host OS in a Java application, fixing DST issues






No packages published