Skip to main content

parse_time

Function parse_time 

Source
pub fn parse_time(text: &str) -> Option<(u32, u32)>
Expand description

Parses a HH:MM time.

A text that does not have that shape, or that names an hour or a minute outside the day, is rejected rather than silently repaired.

§Arguments

  • &str - The text to parse.

§Returns

  • Option<(u32, u32)> - The hour and the minute, or None when the text does not name a valid time.