hasSecond60
Signature
Section titled “Signature”hasSecond60(value: string): booleanReturn true if the string is one of GMT’s own kinds with a second-60 field.
- The kinds are a plain time, a plain date-time, a UTC or offset instant, a zoned date-time (one time zone bracket) and a calendar-aware date-time (at most one
u-ca), each in GMT’s strict extended ISO 8601 shape over the whole string, with the seconds written as60("23:59:60","2016-12-31T23:59:60Z","2016-12-31T23:59:60+00:00[UTC]"). - The string must also be a valid value of its kind with the
60read as59, the value Temporal would silently clamp to, by the exact reader for that kind: the date must exist, a zone must exist and agree with a written offset, and a calendar must be one GMT knows. So"2016-02-30T23:59:60","2016-12-31T23:59:60+00:00[Not/AZone]"and"2016-12-31T23:59:60[u-ca=notacal]"return false. It does not check the IERS leap-second list: a real leap second exists only at 23:59:60 UTC at the end of a month in which one was inserted (RFC 3339 §5.7), so"2024-12-31T23:59:60Z"(no leap second that day, IERS Bulletin C 68) and"2024-06-15T12:34:60Z"both return true. For that, useisLeapSecondfromtimescale/. - Accepts optional fractional seconds, after
.or,. - Returns false for every other spelling, even ones Temporal would clamp: a lower-case
tor a space separator, basic format, a time with a leadingTor an offset, a[key=value]annotation other thanu-ca, a second annotation, trailing text and whitespace. Those are not GMT kinds, and the function that reads each kind rejects them on its own.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | string | candidate string |
Returns
Section titled “Returns”true when the whole string is a GMT kind with a second-60 field, otherwise false
Examples
Section titled “Examples”import { hasSecond60 } from "@northguild/gmt/plain/validate";
hasSecond60("2016-12-31T23:59:60Z") // trueSource
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.