isLeapSecond
Signature
Section titled “Signature”isLeapSecond(value: string): booleanimport { isLeapSecond } from "@northguild/gmt/plain/validate";Return true if the provided string is a valid ISO 8601 leap second datetime.
- Validates leap second format using regex: “YYYY-MM-DDT23:59:60Z” or “YYYY-MM-DDT23:59:60+00:00”.
- Accepts optional fractional seconds.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value |
string |
ISO datetime string |
Returns
Section titled “Returns”boolean indicating whether the input string is a valid leap second datetime
Examples
Section titled “Examples”isLeapSecond("2024-12-31T23:59:60Z") // trueisLeapSecond("2024-12-31T23:59:60.123Z") // trueisLeapSecond("2024-12-31T23:59:60+00:00") // trueisLeapSecond("2024-12-31T23:59:60.123+00:00") // trueisLeapSecond("2024-12-31T23:59:59Z") // false