Skip to content

hour

  • The core functions, which every industry uses.
const hour: RegExp = /^(0[0-9]|1[0-9]|2[0-3])$/;

RegExp matching an ISO 8601 hour in extended format: 00–23.

import { hour } from "@northguild/gmt";
hour.test("00") // true
hour.test("12") // true
hour.test("23") // true
hour.test("24") // false (out of range)
hour.test("9") // false (not zero-padded)

regex/time.ts

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.