4 releases

0.1.3 Nov 21, 2021
0.1.2 Nov 17, 2021
0.1.1 Nov 17, 2021
0.1.0 Nov 16, 2021

#205 in Value formatting

Download history 609/week @ 2024-07-21 537/week @ 2024-07-28 585/week @ 2024-08-04 668/week @ 2024-08-11 723/week @ 2024-08-18 722/week @ 2024-08-25 524/week @ 2024-09-01 470/week @ 2024-09-08 850/week @ 2024-09-15 637/week @ 2024-09-22 759/week @ 2024-09-29 540/week @ 2024-10-06 894/week @ 2024-10-13 728/week @ 2024-10-20 542/week @ 2024-10-27 686/week @ 2024-11-03

2,924 downloads per month
Used in 4 crates

MIT license

22KB
453 lines

time-humanize

A rust crate that displays duration in a human readable format.

This project is a port of chrono-humanize-rs and now has 0 dependencies.

Usage

use std::time::Duration;
use time_humanize::HumanTime;


let duration = Duration::from_secs(60);
let human_time = HumanTime::from(duration);
println!("{}", human_time);

lib.rs:

time-humanize - A crate to display std::time::Duration in a human readable way

Example

use std::time::Duration;
use time_humanize::HumanTime;

let duration = Duration::from_secs(60);

println!("{}", HumanTime::from(duration));
println!("{}", HumanTime::from_seconds(-60));

Dependencies

~175KB