Skip to main content

Function: formatTimeInTz()

formatTimeInTz(instant, timeZone): string

Defined in: src/lib/dates/tz.ts:42

Wall-clock time (HH:MM, 24h) of instant in timeZone.

Renders only hours and minutes (no seconds) using a fixed 24-hour clock, independent of locale.

Parameters

instant

Date

The absolute point in time (a UTC-based Date) to render.

timeZone

string

IANA timezone identifier (e.g. America/New_York); invalid ids throw RangeError.

Returns

string

The local time as zero-padded HH:MM on a 24-hour clock (e.g. 09:05, 17:30).

Throws

RangeError If timeZone is not a valid IANA timezone identifier.

Throws

RangeError If instant is an invalid Date.