Check UTC Offset
Type guard that checks if a value is a valid UTC offset string.
isValidUTCOffset
Type guard that checks if a value is a valid UTC offset string.
Function Signature
isValidUTCOffset(value: unknown): value is UTCOffset;Parameters
value: The value to check (any type)
Returns
true if the value is a valid UTC offset string, false otherwise
Example Usage
playground.ts
Validation Rules
- Must start with "UTC" prefix
- Must be followed by + or - sign
- Hours must be 1-2 digits
- Must include colon separator
- Minutes must be exactly 2 digits
- Followed by valid time components (hours 00-14, minutes 00/15/30/45)
Alias
This guard is also available as following aliases:
isValidUTCisValidUTCOffSet
Type Definition
type UTCOffset = `UTC${PositiveUTCHour | NegativeUTCHour}:${UTCMinute}`;Last updated: Fri, May 22, 2026 07:46:19AM (Coordinated Universal Time)
