chrono-human-duration

Crates.iochrono-human-duration
lib.rschrono-human-duration
version0.1.1
sourcesrc
created_at2020-01-24 16:37:56.297782
updated_at2020-01-24 16:48:08.997339
descriptionSimple human formatting of chrono::Duration
homepage
repositoryhttps://github.com/derekdreery/chrono-human-duration
max_upload_size
id201567
size3,731
Richard Dodd (derekdreery)

documentation

README

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");
Commit count: 3

cargo fmt