Skip to main content

parse_duration

Function parse_duration 

Source
pub fn parse_duration(s: &str) -> Result<Duration, String>
Expand description

Parse 600s, 5m, 2h, 30d, 2w, 500ms, or a bare integer (seconds). Days and weeks exist because retention, dunning, and cadence windows are naturally written in them — 30d reads, 720h gets checked with a calculator.