isLeapSecond
Signature
Section titled “Signature”isLeapSecond(isoString: string): booleanReturn true when a UTC instant string is one of the 27 inserted leap seconds.
- A table lookup, not a pattern match:
23:59:60is well-formed on any day and real on 27 of them, the days the IERS leap-second table built into GMT lists (Leap_Second.dat through Bulletin C 72, 6 July 2026). The table is closed (continuous UTC from 20 May 2027, CGPM 2026), so 2016-12-31 is the last. For the syntax test alone, usehasSecond60. - Accepts the inserted second in any offset spelling (
2017-01-01T08:59:60+09:00). - Leap smearing is not a leap second: a smeared clock never reads
23:59:60and is up to a second off true UTC around an insertion. GMT cannot detect smearing. falseis also the answer for every ordinary second.- Compatibility: in 1.19.0 and earlier
isLeapSecond(inplain/) was the syntactic second-60 test, nowhasSecond60; a call relying on that now returnsfalseon days with no insertion, and for a second 60 that is not an extended-format instant ("23:59:60", no designator, a lowercaset, basic format).
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
isoString | string | ISO 8601 instant string |
Returns
Section titled “Returns”true for an inserted leap second, or false otherwise and on invalid input
Examples
Section titled “Examples”import { isLeapSecond } from "@northguild/gmt/timescale/validate";
isLeapSecond("2016-12-31T23:59:60Z") // trueSource
Section titled “Source”Accessibility
© 2026 NorthGuild · Licences
Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.