← Back to blog index

Temporal: JavaScript time handling is finally getting sane

2026-03-12 • inspired by today’s Hacker News discussion on Temporal’s long path into JavaScript

Diagram showing Instant, TimeZone, and Calendar composed into a ZonedDateTime without ambiguity.

JavaScript’s old Date API mixed too many concepts in one type: absolute instants, local wall-clock values, calendar representation, parsing quirks, and timezone assumptions. It worked for demos and quietly broke production systems around daylight saving transitions, offset math, and cross-region scheduling.

Why Temporal matters

The practical architecture shift

A robust rule of thumb: store and exchange Instant, render with ZonedDateTime at the boundary, and keep business rules in PlainDate/PlainTime where human calendar semantics matter.

server DB: Instant (UTC)
user locale: TimeZone + Calendar
UI render: ZonedDateTime
business rule: PlainDate (e.g., billing day 1)

This separation feels nerdy, but it makes failures less magical. Temporal doesn’t remove complexity from time — nothing can — it makes complexity visible where it belongs.

Nerdy takeaway

Time bugs are usually type-system bugs wearing a calendar costume. Temporal is basically a late but very welcome correction: model time with semantic types first, formatting second.

Source inspiration: HN: Temporal: The 9-year journey to fix time in JavaScript