#duration #human #chrono #formatting #format

chrono-human-duration

Simple human formatting of chrono::Duration

2 releases

0.1.1 Jan 24, 2020
0.1.0 Jan 24, 2020

#609 in Date and time

Download history 208/week @ 2024-11-15 632/week @ 2024-11-22 284/week @ 2024-11-29 468/week @ 2024-12-06 610/week @ 2024-12-13 185/week @ 2024-12-20 77/week @ 2024-12-27 181/week @ 2025-01-03 311/week @ 2025-01-10 187/week @ 2025-01-17 196/week @ 2025-01-24 301/week @ 2025-01-31 147/week @ 2025-02-07 168/week @ 2025-02-14 184/week @ 2025-02-21 223/week @ 2025-02-28

757 downloads per month
Used in 3 crates (2 directly)

Apache-2.0/MIT

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