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.

18 lines • 935 B
/** * Return the first leap second after a UTC instant, as its UTC label `…T23:59:60Z`. * * - From the IERS leap-second table built into GMT (Leap_Second.dat through Bulletin C 72, * 6 July 2026). * - `""` for every instant from 2016-12-31T23:59:60Z on: there are no more. The table is closed * (continuous UTC from 20 May 2027, CGPM 2026). * - `""` also on invalid input or a date before 1972; check with `isValidInstant` to tell them apart. * * @param isoString ISO 8601 instant string * @returns the next leap second's UTC label, or "" when there is none or on invalid input * * @example nextLeapSecond("2016-01-01T00:00:00Z") // "2016-12-31T23:59:60Z" * @example nextLeapSecond("1999-08-22T00:00:00Z") // "2005-12-31T23:59:60Z" * @example nextLeapSecond("2016-12-31T23:59:60Z") // "" * @example nextLeapSecond("2024-01-01T00:00:00Z") // "" */ export declare function nextLeapSecond(isoString: string): string;