pub fn parse_relative_duration(input: &str) -> Option<Duration>Expand description
Parse a relative duration like 7d, 24h, 1w, 1m, 90s, 1y.
Calendar units (m, y) are imprecise; for windows we use these
conventions:
s— secondsmin— minutes (use this rather thanmto avoid the months-vs-minutes ambiguity)h— hoursd— daysw— weeks (= 7 days)m— months (= 30 days; matches what most users mean by “1m” in analytics windows)y— years (= 365 days)
For exact calendar math, pass an ISO-8601 timestamp instead.