Crates.io | chrono-human-duration-modified |
lib.rs | chrono-human-duration-modified |
version | 0.1.2 |
source | src |
created_at | 2020-12-10 23:21:33.168874 |
updated_at | 2020-12-10 23:21:33.168874 |
description | Simple human formatting of chrono::Duration |
homepage | |
repository | https://github.com/SmailBarkouch/chrono-human-duration |
max_upload_size | |
id | 321663 |
size | 12,335 |
Very small crate for format durations for humans.
In comparison to the original repo...
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::seconds(20);
assert_eq!(d.format_human().to_string(), "just now");