UNPKG

@northguild/gmt

Version:

Date and time library for JavaScript and TypeScript, built on TC39 Temporal: time zones, DST, business days, ISO 8601 strings in and out. Never throws.

41 lines • 1.78 kB
import { Temporal } from "../temporal.js"; /** * `Temporal.Now.instant()`, never earlier than a `Date.now()` read just before it. * * @returns the current instant * @throws whatever `Temporal.Now.instant` throws */ export declare function nowInstant(): Temporal.Instant; /** * `Temporal.Now.zonedDateTimeISO(timeZone)`, never earlier than a `Date.now()` read just before it. * A bad zone argument throws the polyfill's own error. * * @param timeZone a time zone identifier; omitted for the system zone * @returns the current date and time in the zone * @throws whatever `Temporal.Now.zonedDateTimeISO` throws */ export declare function nowZonedDateTimeISO(timeZone?: string): Temporal.ZonedDateTime; /** * The current date and time in the zone as a `PlainDateTime`, read from {@link nowZonedDateTimeISO}. * * @param timeZone a time zone identifier; omitted for the system zone * @returns the current wall-clock date and time * @throws whatever `Temporal.Now.zonedDateTimeISO` throws */ export declare function nowPlainDateTimeISO(timeZone?: string): Temporal.PlainDateTime; /** * The current date in the zone as a `PlainDate`, read from {@link nowZonedDateTimeISO}. * * @param timeZone a time zone identifier; omitted for the system zone * @returns the current date * @throws whatever `Temporal.Now.zonedDateTimeISO` throws */ export declare function nowPlainDateISO(timeZone?: string): Temporal.PlainDate; /** * The current time in the zone as a `PlainTime`, read from {@link nowZonedDateTimeISO}. * * @param timeZone a time zone identifier; omitted for the system zone * @returns the current wall-clock time * @throws whatever `Temporal.Now.zonedDateTimeISO` throws */ export declare function nowPlainTimeISO(timeZone?: string): Temporal.PlainTime;