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.

14 lines • 734 B
/** * The core of `resolveLocal`: the instant a local date-time names in a zone, under one * disambiguation. Never throws. * * @param localDateTime a PlainDateTime string * @param timeZone an IANA zone or a numeric offset * @param disambiguation how a repeated or skipped wall time resolves * @returns the instant as an ISO 8601 string, or `""` when any input is invalid or the time is * rejected * * @example resolveLocalInstant("2024-06-15T12:00:00", "UTC", "compatible") // "2024-06-15T12:00:00Z" * @example resolveLocalInstant("2024-03-10T02:30:00", "America/New_York", "reject") // "" */ export declare function resolveLocalInstant(localDateTime: string, timeZone: string, disambiguation: string | undefined): string;