2 releases
0.1.1 | Jan 24, 2020 |
---|---|
0.1.0 | Jan 24, 2020 |
#41 in #human
192 downloads per month
Used in 3 crates
(2 directly)
4KB
67 lines
chrono-human-duration
Very small crate for format durations for humans.
Example
use chrono_human_duration::ChronoHumanDuration;
use chrono::Duration;
let d = Duration::weeks(2) + Duration::days(3);
assert_eq!(d.format_human().to_string(), "2 weeks ago");
let d = Duration::minutes(20);
assert_eq!(d.format_human().to_string(), "just now");
Dependencies
~1MB
~18K SLoC