Skip to content
clockworktz

Live demo

clockworktz, running in your browser.

Every output on this page is computed live by clockworktz 1.0.2 from npm. Change the inputs, read the code, and copy it straight into your app.

01

Live clocks that never drift

onTick fires on every whole second of wall-clock time, so clocks stay in step instead of drifting like setInterval. Each face is positioned from the zone’s real offset, including half- and quarter-hour ones.

onTickformatgetZoneInfoDocs

02

Convert wall time between zones

Pick a wall time in one zone and see it everywhere else. A string without an offset is read in the source zone, never in your machine’s zone.

convertinterpretLocalDocs

03

Some local times never happen. Some happen twice.

The chart plots wall-clock time against UTC around a real transition: a jump up is a gap, a jump down is an overlap. The dots show where each disambiguation strategy lands, exactly as Temporal resolves them.

interpretLocalgetTransitionsfromUTCDocs

04

Every offset change, to the second

Chart a zone’s offset through a year, count down to its next change, and watch for it live. Try Samoa in 2011, Pyongyang in 2015 and 2018, Caracas in 2016, or rules in 2100.

getTransitionsgetNextTransitionwatchZoneTransitionsDocs

05

Format in any zone and locale

A date-fns compatible subset of tokens, with offsets, abbreviations and long zone names. Unsupported tokens throw instead of printing something wrong.

formatFORMAT_PATTERNSformatRelativeformatRangeformatDurationDocs

06

Strict parsing, never in the host’s zone

ISO 8601 with an offset is an instant. Without one, it’s wall time in the defaultTimezone you choose. Invalid dates such as 30 February are rejected, not rolled over.

parsesafeParseparseOffsetDocs

07

Every zone, by offset and country

The building blocks for a timezone picker. Labels describe the zone at the date you pass, so January and July differ. Choose a bar to list its zones.

listTimeZonesgetZoneCountriesDocs

08

Two engines, and signed data updates

Switch every demo on this page between the platform’s Intl data and the pinned IANA tzdb. Then run a real signed update from jsDelivr, or tamper with the manifest and watch it get rejected.

initClockworkTZverifyManifestSignatureensureFreshTzdbDocs

09

One error class to catch

Invalid zones, input, patterns and options all throw a TimezoneError. With disambiguation set to reject, skipped and repeated times throw its two subclasses.

TimezoneErrorInvalidTimeErrorAmbiguousTimeErrorDocs