Skip to content

std/zone

std/zone

Import from @norbital-ai/std/zone

std/zone: wall-clock ⇄ UTC in an IANA zone through Intl (std/date and std/calendar build on it). Milliseconds in a UTC day.

DAY_MS const

const DAY_MS: 86400000

Milliseconds in a UTC day.

Source: packages/std/src/zone.ts:3

localOf function

function localOf(ms: number, zone: string): { date: string; msOfDay: number; }

The zone-local calendar day and milliseconds into it of a UTC instant.

Parameters

NameTypeDescription
msnumber
zonestring

Source: packages/std/src/zone.ts:25

utcOf function

function utcOf(date: string, msOfDay: number, zone: string): number

The UTC instant (ms) of a zone-local wall time, as Temporal's 'compatible': in a fold the earlier instant, in a gap the wall time read with the offset before the gap (so it lands after it).

Parameters

NameTypeDescription
datestring
msOfDaynumber
zonestring

Source: packages/std/src/zone.ts:39