isTime
The isTime() function checks that a string matches the TheTime format (time<timestamp><"-" | "+">). It acts as a type guard.
Interactive example
Syntax
typescript
function isTime(input: string): input is TheTimeParameters
input: String to validate.
Return value
true if the string follows the TheTime format, otherwise false. When true, TypeScript narrows input to TheTime.
See also
createTime- Builds aTheTimefrom native valuesis- Checks theTheDateformat
