Skip to content

OffsetInstant

An absolute instant paired with the local UTC offset in force where the event happened.

import type { OffsetInstant } from "@northguild/gmt";
MemberTypeDescription
instantstringThe UTC instant, ISO 8601 ending in Z (e.g. 2024-07-15T16:00:00Z). Orders events globally.
offsetstringThe UTC offset in force where the event happened, ±HH:MM (or ±HH:MM:SS for a pre-1972 zone that did not run on a whole minute). Renders the event as the human on the ground saw it.
timeZone?stringThe IANA name of the zone, when one is known. Most feeds send none, so toOffsetInstant leaves it out unless the string or its timeZone argument names a zone.
interface OffsetInstant {
/**
* The UTC instant, ISO 8601 ending in `Z` (e.g. `2024-07-15T16:00:00Z`). Orders events globally.
*/
instant: string;
/**
* The UTC offset in force where the event happened, `±HH:MM` (or `±HH:MM:SS` for a pre-1972
* zone that did not run on a whole minute). Renders the event as the human on the ground saw it.
*/
offset: string;
/**
* The IANA name of the zone, when one is known. Most feeds send none, so `toOffsetInstant` leaves
* it out unless the string or its `timeZone` argument names a zone.
*
* @defaultValue None. The pair names no zone, and `offset` alone places the instant on a local
* clock.
*/
timeZone?: string;
}

instant/convert/toOffsetInstant.ts