Agent Wranglers

LOC-46Recommended

Keep the time zone database current in every runtime

Every server, container and runtime that converts times runs the latest IANA tz release within 30 days of its publication.

How to do it

Governments change clocks at short notice, and IANA publishes a release every few months. Release 2026e, for example, moves Manitoba to a fixed UTC−05 from 31 October 2026. Each layer carries its own copy. The operating system, Java, ICU and Node.js, which bundles ICU, all differ. Python reads the system copy or the tzdata package. Rebuild container images when tzdata changes, and update the tzdata package where your language has one. Phones and browsers update with the system. Future events survive a rule change only when stored as Store future local times as a local time and a zone name says.

Examples

JavaScript example

const latest = (await (await fetch('https://data.iana.org/time-zones/tzdb/version')).text()).trim();
if (process.versions.tz !== latest) console.error(`tz data ${process.versions.tz}, latest ${latest}`);

Python example

from importlib.metadata import version
from urllib.request import urlopen

latest = urlopen("https://data.iana.org/time-zones/tzdb/version").read().decode().strip()
print("tzdata package", version("tzdata"), "latest release", latest)

How to check

A CI job reads the tz release each service reports and compares it with https://data.iana.org/time-zones/tzdb/version. It fails when a service runs an older release more than 30 days after the newer one came out.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/localization/time-and-time-zones/time-zone-database-updates">Agent Wranglers localization playbook</a>. In code you write, add a comment next to it with the same link.