Skip to content

Class: ZonedDate ​

Defined in: packages/core/src/types/zoned-date.ts:23

A TIMESTAMP/TIME WITH TIME ZONE value with its zone preserved.

date is the exact UTC instant — the same value the default 'instant' mode returns — and zone is the IANA region name ('Europe/Lisbon') or fixed offset ('+02:30') the value was stored with. Returned by columns when the connection sets timeZones: 'zoned'; accepted as a parameter value for WITH TIME ZONE columns in either mode.

For wall-clock rendering use the platform's full tzdata via Intl, e.g. zd.date.toLocaleString('en-GB', { timeZone: zd.zone }).

Constructors ​

Constructor ​

ts
new ZonedDate(date, zone): ZonedDate;

Defined in: packages/core/src/types/zoned-date.ts:24

Parameters ​

ParameterTypeDescription
dateDateThe exact instant (UTC). For TIME WITH TIME ZONE: on 1970-01-01.
zonestringIANA zone name or '±HH:MM' fixed offset, exactly as stored.

Returns ​

ZonedDate

Properties ​

PropertyModifierTypeDescriptionDefined in
datereadonlyDateThe exact instant (UTC). For TIME WITH TIME ZONE: on 1970-01-01.packages/core/src/types/zoned-date.ts:26
zonereadonlystringIANA zone name or '±HH:MM' fixed offset, exactly as stored.packages/core/src/types/zoned-date.ts:28

Methods ​

toString() ​

ts
toString(): string;

Defined in: packages/core/src/types/zoned-date.ts:36

Returns ​

string


valueOf() ​

ts
valueOf(): number;

Defined in: packages/core/src/types/zoned-date.ts:32

Epoch millis of the instant — makes ZonedDate sortable/comparable.

Returns ​

number

MIT Licensed. Contains data derived from the Firebird project under IDPL/IPL.