Skip to main content

parse_duration

Function parse_duration 

Source
pub fn parse_duration(arg: &str) -> Result<Duration, Error>
Available on crate feature cli only.
Expand description

Parses a human-readable duration such as 30s, 500ms, 5min, 1h 30m or 2d.

Days are 24 hours and weeks are 7 days. Months and years are rejected because their length varies. A bare 0 is accepted as zero.