# leapSecondsBetween

Industry: Core

## Signature

```ts
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.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `start` | `string` | ISO 8601 instant string |
| `end` | `string` | ISO 8601 instant string |

## Returns

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

## Examples

```ts
import { leapSecondsBetween } from "@northguild/gmt/timescale/calculate";

leapSecondsBetween("2020-01-01T00:00:00Z", "2024-01-01T00:00:00Z") // 0
```

## Source

[timescale/calculate/leapSecondsBetween.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/timescale/calculate/leapSecondsBetween.ts)
