I know that IANA keeps a timezone database (tzdata) that is used by several systems. But Java seems to have its own mechanics to handle timezones.
How does it work?
To translate timezones, Java Runtime Environment (JRE) internally checks for the $JAVA_HOME/lib/tzdb.dat
file, that is the Java zone information file. This file is a Java custom binary format and it is generated from the IANA time zone database.
tzdb.dat
format, the TzdbZoneRulesCompiler (part of JDK) should be used.tzdb.dat
file and bundled within the JRE.You can also check which version of IANA database is shipped with a specific Java Runtime (provided by Oracle). For better compatibility, OpenJDK releases ship with the same version of IANA database that Oracle JDK does.
Historically, keeping JRE updated is not enough to keep IANA database updated. As of May 28, 2025, there is no release of JRE being shipped with tzdata2025b
(current latest version, available since March 22, 2025). That is, when this answer is being written, timezones for the latest JRE available are more than two months outdated. This means that Java maintainers keeps outdated version of the timezone database and don't promote new versions of the JRE to keep it updated.
The only option to keep Timezone info updated on Java is to manually generate tzdb.dat
file from the latest version of IANA database.
To achieve this you can, alternatively:
Download latest version of IANA database, compile by your own using the JDK TZDB Compiler and replace your installations's $JAVA_HOME/lib/tzdb.dat
file.
Download the latest version of IANA database already compiled as a tzdb.dat (thanks to jeremywall/java-tzdb-builder) file and replace your installations's $JAVA_HOME/lib/tzdb.dat
file.
There are also some tools that embed the JDK TZDB Compiler to allow the compilation of IANA tzdata without the need of the Full JDK. These are the most popular solutions for production systems:
Oracle TZUpdater Tool (Requires My Oracle Support Account)
The tzdb.dat
file is loaded by Java during startup, so an application restart is required for changes to take effect.
According to ZoneRulesProvider doc (thanks to user85421):
Many systems would like to update time-zone rules dynamically without stopping the JVM. When examined in detail, this is a complex problem. Providers may choose to handle dynamic updates, however the default provider does not.
So hot updates (without restarting the JVM) of tzdata are not supported by Java default provider.
It is theoretically possible to overcome this limitation writing an alternative class that extends java.time.zone.ZoneRulesProvider
and implements a dynamic update for the table, however, searching on the internet it seems that no one has ever ventured into this task.
If you really want to explore this possibility of dynamic updates:
Write a class that extends ZoneRulesProvider with all desired functionality. I recommend using the default provider implementation in TzdbZoneRulesProvider class.
Set the system property java.time.zone.DefaultZoneRulesProvider
with the fully-qualified name of your new class.
Doing so, JVM will load your provider instead of the default one to load timezone info. Check ZoneRulesProvider doc for additional information.