Skip to content

parseHourFromTime

  • The core functions, which every industry uses.
parseHourFromTime(value: string): string

Return the hour (0-23) for a given ISO 8601 time string.

  • Returns zero-padded string for hour.
  • Returns "" for invalid input.
ParameterTypeDescription
valuestringISO time string

Hour (00-23) or "" on invalid input

import { parseHourFromTime } from "@northguild/gmt/plain/parse";
parseHourFromTime("12:30:00") // "12"
output 

plain/parse/parseHourFromTime.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.