leapSecondsBetween
Signature
Section titled “Signature”leapSecondsBetween(start: string, end: string): number | nullReturn how many leap seconds start between two UTC instants, signed.
- From the IERS leap-second table built into GMT (Leap_Second.dat through Bulletin C 72, 6 July 2026). The table is closed: after the last insertion (2016-12-31) there are none.
- Counts each leap second whose second starts in
[start, end). An inserted second starts at…T23:59:60.000Z(ITU-R TF.460-6 Annex 1 §2.2): from…T23:59:60Zto the next…T00:00:00Zis 1; from…T23:59:59Zto…T23:59:60Zis 0; from…T23:59:60.5Zto the next…T00:00:00Zis 0. - Over whole days this is the change in TAI − UTC (
taiMinusUtc). Inside an inserted second the two differ: TAI − UTC changes at 00:00:00, the count at 23:59:60.000. - Signed: negative when
endis beforestart. nullwhen either instant is before 1972-01-01 or invalid.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
start | string | ISO 8601 instant string |
end | string | ISO 8601 instant string |
Returns
Section titled “Returns”the signed count, or null on invalid input or a date before 1972
Examples
Section titled “Examples”import { leapSecondsBetween } from "@northguild/gmt/timescale/calculate";
leapSecondsBetween("2020-01-01T00:00:00Z", "2024-01-01T00:00:00Z") // 0Source
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.