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
new ZonedDate(date, zone): ZonedDate;Defined in: packages/core/src/types/zoned-date.ts:24
Parameters
| Parameter | Type | Description |
|---|---|---|
date | Date | The exact instant (UTC). For TIME WITH TIME ZONE: on 1970-01-01. |
zone | string | IANA zone name or '±HH:MM' fixed offset, exactly as stored. |
Returns
ZonedDate
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
date | readonly | Date | The exact instant (UTC). For TIME WITH TIME ZONE: on 1970-01-01. | packages/core/src/types/zoned-date.ts:26 |
zone | readonly | string | IANA zone name or '±HH:MM' fixed offset, exactly as stored. | packages/core/src/types/zoned-date.ts:28 |
Methods
toString()
toString(): string;Defined in: packages/core/src/types/zoned-date.ts:36
Returns
string
valueOf()
valueOf(): number;Defined in: packages/core/src/types/zoned-date.ts:32
Epoch millis of the instant — makes ZonedDate sortable/comparable.
Returns
number