# instantLeapSecond

Industry: Core

```ts
const instantLeapSecond: RegExp = /^[^[]*?[Tt ]\d{2}:?\d{2}:?60(?:[.,]\d+)?[-+Zz[]/;
```

RegExp fragment matching an ISO 8601 leap second in every shape `Temporal.Instant.from` accepts.

## Examples

```ts
import { instantLeapSecond } from "@northguild/gmt";
```

```ts
instantLeapSecond.test("2016-12-31T23:59:60Z") // true
instantLeapSecond.test("2016-12-31 23:59:60Z") // true (space separator)
instantLeapSecond.test("20161231t235960Z") // true (basic format)
instantLeapSecond.test("2016-12-31T23:59:59Z") // false (second = 59)
instantLeapSecond.test("2016-12-31T23:59:60") // false (no designator, so not an instant)
instantLeapSecond.test("2024-01-01T00:00:00Z[x=T123460Z]") // false (inside an annotation value)
```

## Source

[regex/leap-second.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/regex/leap-second.ts)
