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

#67 in Date and time

Download history 105/week @ 2021-11-13 343/week @ 2021-11-20 221/week @ 2021-11-27 129/week @ 2021-12-04 122/week @ 2021-12-11 124/week @ 2021-12-18 110/week @ 2021-12-25 206/week @ 2022-01-01 114/week @ 2022-01-08

556 downloads per month
Used in onefetch

MIT license

21KB
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

~99KB