Parses HH:MM string into hours and minutes.

Type signature

(text?: string) => [number, number]

Examples

parseHourMinutePair("12:34");
// ⇒ [12, 34]
Try in REPL

Questions

  • How to parse time string into hours and minutes?

TypeScript sourceJavaScript source