isValidTime
Signature
Section titled “Signature”isValidTime(value: string): booleanisValidTime(value: void | {} | null | undefined): booleanisValidTime(value: unknown): value is stringReturn true when value is a valid ISO PlainTime string.
- The whole string must match
plainTime. - Accepts no annotation of any kind: a time zone, a calendar (
[u-ca=iso8601]) or an elective one ([foo=bar]) returnsfalse. - Rejects leap seconds (e.g., “23:59:60”).
- Rejects invalid times (e.g., “24:00:00”, “23:60:00”).
- A value that is not a string, a
Stringobject included, returnsfalse. Atrueresult narrows anunknownvalue tostring.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | string | any value; a string is checked as an ISO PlainTime |
Returns
Section titled “Returns”boolean indicating validity
Examples
Section titled “Examples”import { isValidTime } from "@northguild/gmt/plain/validate";
isValidTime("12:34:56") // 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.