Skip to content

leapSecondsBetween

  • The core functions, which every industry uses.
leapSecondsBetween(start: string, end: string): number | null

Return 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:60Z to the next …T00:00:00Z is 1; from …T23:59:59Z to …T23:59:60Z is 0; from …T23:59:60.5Z to the next …T00:00:00Z is 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 end is before start.
  • null when either instant is before 1972-01-01 or invalid.
ParameterTypeDescription
startstringISO 8601 instant string
endstringISO 8601 instant string

the signed count, or null on invalid input or a date before 1972

import { leapSecondsBetween } from "@northguild/gmt/timescale/calculate";
leapSecondsBetween("2020-01-01T00:00:00Z", "2024-01-01T00:00:00Z") // 0
output 

timescale/calculate/leapSecondsBetween.ts

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.