#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

#41 in #human

Download history 78/week @ 2024-03-11 54/week @ 2024-03-18 45/week @ 2024-03-25 110/week @ 2024-04-01 95/week @ 2024-04-08 121/week @ 2024-04-15 100/week @ 2024-04-22 114/week @ 2024-04-29 24/week @ 2024-05-06 55/week @ 2024-05-13 53/week @ 2024-05-20 29/week @ 2024-05-27 47/week @ 2024-06-03 38/week @ 2024-06-10 41/week @ 2024-06-17 62/week @ 2024-06-24

192 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