Chapter 07·The Intl Toolbox·~8 min·
Time Zones and Daylight Saving Time
Civil time zones use 37 distinct UTC offsets, including 30-minute and 45-minute increments, and change through government legislation. Storing IANA time zone identifiers preserves accurate local times across daylight saving and regulatory transitions.
Overview
A fixed UTC offset such as `+02:00` records only one moment's offset and loses future daylight saving transitions. Governments change time zone boundaries and DST schedules by law. Applications must store an instant in UTC paired with an IANA time zone identifier.
Core rule
Store past timestamps as UTC instants, store future scheduled events as local wall time plus an IANA time zone identifier, and never assume offsets are whole hours.
Specification note: Nepal observes UTC+05:45. Systems that store time zone offsets as whole-hour integers cannot represent local time in Kathmandu.
Failure mode
Scheduling systems break when they store a numeric UTC offset instead of an IANA time zone identifier. Governments regularly modify standard offsets and daylight saving rules. Morocco returned to permanent UTC+0 on September 20, 2026. Russia abolished DST in 2011 and shifted Moscow from UTC+4 to UTC+3 in 2014. Turkey adopted permanent UTC+3 in 2016.
The IANA Time Zone Database (tzdata) tracks historical and future rule changes across multiple annual releases. Systems that store a static offset such as UTC+05:00 instead of Asia/Karachi calculate incorrect wall-clock times whenever a region updates its time zone law or crosses a DST boundary.
Time zones are political boundaries with shifting daylight saving rules, not static mathematical offsets. Storing fixed offsets corrupts scheduled events.
Business stakes & user risk
A scheduled flight, medical appointment, or webinar stored as 'UTC+1' will shift by an hour when Daylight Saving Time begins, causing missed appointments.
Rule of thumb
Store timestamps as UTC instants and time zones as IANA identifiers (e.g., 'America/New_York'). Never store raw UTC offsets for future events.
The Novice Trap vs. Production Standard
Contrast the intuitive assumption with the architecture required for global releases.
“A time zone is simply a fixed number of hours added to UTC, like 'GMT+2'.”
Naive approach: Storing static offset
{ eventTime: "2026-11-15T09:00:00", offset: "+02:00" }Defect:When Daylight Saving Time ends in October, the local appointment time unexpectedly moves to 08:00 or 10:00.
Cities change offsets twice a year for Daylight Saving Time, and governments occasionally modify time zones or abolish DST on short notice.
Production standard: UTC timestamp plus IANA zone
{ timestampUtc: "2026-11-15T07:00:00Z", timeZone: "Europe/Berlin" }Benefit:The runtime resolves the exact local wall-clock time using up-to-date IANA tzdata tables regardless of seasonal shifts.
Cross-Functional Review Questions
Questions for product managers, designers, engineers, and testers to ask during sprint reviews.
“Do database schemas store future calendar events with IANA time zone strings?”
“How does our scheduling UI display event times across international participants?”
“Are recurring calendar rules tested across the spring-forward and fall-back DST weekends?”
“Does the time zone selector allow searching by city rather than raw GMT offsets?”
Mechanism
UTC offsets, IANA time zones, and tzdata
A UTC offset such as UTC+02:00 represents a fixed time difference from UTC at a single moment. An IANA time zone identifier such as Europe/Berlin references a historical and future rule set in the IANA Time Zone Database (tzdata). Governments regularly legislate changes to standard offsets and daylight saving time (DST) schedules, and the IANA database publishes multiple updates each year to track those laws.
Consequently, past events and future human schedules require different storage schemas. Record completed events (audit logs, transactions) as UTC instants. Record future human-scheduled events (meetings, alarms, flights) as local wall-clock time plus the IANA time zone identifier (2026-10-28T09:00 in Europe/London). Converting a future meeting to UTC at booking time locks in the current offset and shifts the meeting by an hour if the jurisdiction amends its DST rules before the event occurs.
Time zone arithmetic must also support sub-hour offsets and discontinuities. India uses UTC+05:30, Nepal uses UTC+05:45, and Lord Howe Island shifts clocks by 30 minutes for DST. During spring-forward transitions, local wall times inside the skipped window do not exist. During fall-back transitions, local wall times inside the repeated window occur twice.
Interactive demo
Guided exercises
- 1Keep Australia/Lord_Howe selected and read “the flip, frame by frame”. Local time jumps from `01:59` (`+10:30`) to `02:30` (`+11:00`), demonstrating a 30-minute DST transition.
- 2Pick “Pacific/Apia · skipped a calendar day”. One minute after `23:59` on December 29, 2011, clocks in Apia read `00:00` on December 31 because the territory crossed the International Date Line.
- 3Find Asia/Kathmandu and Asia/Kolkata in the live world clock. Kathmandu runs at `+05:45` and Kolkata runs at `+05:30`. Time zone selectors and offset math cannot assume integer hour offsets.
- 4Pick “Africa/Casablanca · rule change, Sep 2026”, then set “Target zone 3” to Africa/Casablanca in “Convert a meeting”. Jurisdictions update their offset rules in `tzdata`. Runtimes with updated `tzdata` compute a different offset for dates after a rule change than runtimes with older tables.
- 5In “Convert a meeting”, keep the defaults (09:00 on 2026-10-28, “Source zone” Europe/London) and compare the two target rows. New York shows `05:00` (`GMT-4`) with a DST boundary warning because the United States ends DST on November 1, 2026, one week after the UK.
- 6Change “Source zone” to America/New_York and set “Meeting time” to 02:30 on 2026-03-08. A warning reports that `02:30` does not exist on that date in New York because clocks spring forward from `02:00` to `03:00`.
UTC+10:30 standard and UTC+11:00 in DST: the only place whose DST shift is 30 minutes.
The flip, frame by frame
01:59, before the DST change
4 Oct 2026, 01:59
UTC+10:30
02:30, after the DST change
4 Oct 2026, 02:30
UTC+11:00
At 02:00, clocks move forward to 02:30.
Convert a meeting
Enter a wall-clock time and its zone to see the same instant in up to three other zones. Rows use Intl.DateTimeFormat with timeZone and timeZoneName.
| Zone | Meeting reads | Offset | |
|---|---|---|---|
| Europe/London (source) | Wed, 28 Oct 2026, 09:00 GMT | UTC+00:00 | |
| America/New_York | Wed, 28 Oct 2026, 05:00 GMT-4 | UTC-04:00 | DST boundary within a week of this meeting |
| Asia/Tokyo | Wed, 28 Oct 2026, 18:00 GMT+9 | UTC+09:00 |
The badge marks a target zone whose UTC offset changes within 7 days after the meeting. A weekly meeting fixed to the source zone's clock shifts by that change in the target zone.
Live world clock · —
Updates every second. The offset column uses timeZoneName: "longOffset".
| IANA zone | Local time | Offset |
|---|---|---|
| UTC | — | — |
| Pacific/Honolulu | — | — |
| America/Los_Angeles | — | — |
| America/New_York | — | — |
| America/Argentina/Buenos_Aires | — | — |
| Europe/London | — | — |
| Europe/Berlin | — | — |
| Africa/Cairo | — | — |
| Asia/Kolkata | — | — |
| Asia/Kathmandu | — | — |
| Asia/Tokyo | — | — |
| Australia/Lord_Howe | — | — |
| Pacific/Auckland | — | — |
| Pacific/Apia | — | — |
Common false assumptions
- Time zones have whole-hour offsets. India is +05:30, Nepal +05:45, and Lord Howe +10:30 standard, +11:00 in DST.
- DST always shifts the clock by an hour. Lord Howe shifts 30 minutes, and Troll Station in Antarctica shifts two hours.
- Every day has 24 hours. With a one-hour shift, the day DST starts has 23 hours and the day it ends has 25. Samoa's Dec 30, 2011 had none.
- UTC and GMT are the same thing. Close enough for most apps. UTC is atomic time; GMT is mean solar time at Greenwich, and leap seconds keep the two within 0.9 seconds.
- A country has one time zone. China spans five geographic zones and uses one, UTC+8. The 50 US states use six, and France uses twelve including overseas territories, the most of any country.
Engineering rules
- Store instants as UTC ISO 8601 with milliseconds.
- Format on the client with
Intl.DateTimeFormat(locale, { timeZone: userTz }). - Take the user's zone from
Intl.DateTimeFormat().resolvedOptions().timeZone; do not make them pick one from a list. - Round-trip test fixtures through both DST transitions (EU: March and October; US: March and November), including a spring-forward wall time that does not exist.
- Update tzdata with each IANA release. Governments change rules on short notice, and a pinned container image keeps the old ones.
Implementation rules
- Store IANA time zone identifiers. Persist identifiers such as
Europe/BerlinorAmerica/Sao_Paulorather than fixed numeric offsets. - Separate past timestamps from future scheduled events. Store completed events (logs, transactions) as UTC instants. Store future appointments as local wall-clock time plus an IANA time zone identifier, following the
Temporal.ZonedDateTimedata model. - Format timestamps with
Intl.DateTimeFormatand an explicittimeZone. Pass{ timeZone: id, timeZoneName: "long" }so the runtime resolves DST transitions and localized zone names fromtzdata. - Keep runtime
tzdatapackages updated. Subscribe to the IANA tzdata announcement list and update operating system and container base images when new releases ship.
Operational context
Roles
Workflow stages
- ·Designing calendar, scheduling, and billing systems
- ·Testing daylight saving transitions
- ·Supporting regions with 30-minute or 45-minute offsets
Production incident
At the end of December 29, 2011, Samoa moved west across the International Date Line to align its business week with Australia and New Zealand. Local clocks jumped directly from 23:59 on December 29 to 00:00 on December 31, skipping December 30, 2011 entirely.