Global Time Zones: A Surprisingly Hard Problem

Blog · Foundations

Global Time Zones: A Surprisingly Hard Problem

Time zones are a human convention layered on top of UTC, and the conventions are messier than most engineers realise. The operational pitfalls in handling time zones across distributed systems.

Ian Gough
Ian GoughFounder & CEO, TimeBeat
6 min read
FoundationsTime zones

TL;DR

  • Time zones are a political artefact layered on top of UTC. They change. Daylight saving rules change. Countries adopt or abandon DST at short notice.
  • Store times as UTC. Convert to a time zone only at the user-facing edge. Keep tzdata updated. Don't try to invent your own DST handling.
  • For audit-significant times, capture both UTC and the originating time zone metadata so the conversion can be reproduced later.

Time zones change. UTC doesn't.

Every distributed system that handles human-readable times sooner or later runs into the fact that time zones are a political artefact, not a physical one. They change. Daylight saving rules change. Countries adopt or abandon DST at short notice. Some time zones have offsets that aren't whole hours (Newfoundland is UTC-3:30; India is UTC+5:30; Nepal is UTC+5:45). Some places observe time changes that align with the lunar calendar rather than the solar one. Some places have multiple legal time zones in the same country (China officially uses one but practically uses several).

The IANA tzdata database tracks all of this and is the canonical source for time zone information. Every operating system and programming language environment depends on tzdata, which means every system that depends on time zones has to update tzdata regularly to stay current. Failing to update tzdata is a common silent failure that surfaces during the next time zone transition.

What to do about it

Three rules. Store times as UTC internally — never store local times as the canonical representation. Convert to a time zone only at the user-facing edge of the system, where the human reader needs to see local time. And keep tzdata updated across the fleet on a regular cadence (tzdata releases happen roughly quarterly).

For times that have legal or audit significance — financial timestamps, legal documents, regulatory filings — capture both the UTC time and the originating time zone metadata. This way the conversion can be reproduced reliably later, even if the originating time zone's rules change between the event and the audit. The cost of capturing the metadata is trivial; the cost of not having it is potentially significant when a regulator asks.

Frequently asked questions

What is tzdata?+
The IANA Time Zone Database, the canonical source for time zone rules used by every modern operating system and programming language. It tracks current and historical time zone offsets, daylight saving rules and time zone boundary changes. It releases updates roughly quarterly as countries change their time zone rules.
Should I store times as UTC or local time?+
UTC, always, for the canonical internal representation. Convert to local time only at the user-facing edge where the human reader needs to see it. Storing local times as the canonical representation creates ambiguity around DST transitions and breaks when time zone rules change.
Do I need to keep tzdata updated?+
Yes. Time zone rules change frequently as countries adopt or abandon DST or modify their time zone boundaries. Outdated tzdata produces silent failures during the next time zone transition. Plan to update tzdata across your fleet on a regular cadence — quarterly is a sensible default.

Talk to us

Got a time-sync question like this in your network?

Book a 30-minute call with a Timebeat engineer — we will tell you which products fit, what the install looks like and what it would cost.