Expand description
Convert seconds to compound duration (week, days, hours, minutes, seconds)
This library provides simple, lightweight functions to format time durations into human-readable compound format strings.
§Examples
use compound_duration::{format_dhms, format_wdhms};
assert_eq!(format_dhms(7259), "2h59s");
assert_eq!(format_wdhms(6_000_000), "9w6d10h40m");Constants§
Functions§
- format_
dhms - Convert seconds to compound duration (days, hours, minutes, seconds)
- format_
ns - Convert nanoseconds to compound duration (days, hours, minutes, seconds, ms, µs, ns)
- format_
wdhms - Convert seconds to compound duration (week, days, hours, minutes, seconds)