#humanize #rest #human

nightly rs-humanize

Format data types into human readable strings

6 releases (stable)

✓ Uses Rust 2018 edition

new 1.2.0 Feb 18, 2020
1.1.0 Feb 18, 2020
1.0.1 Feb 14, 2020
0.1.1 Jan 27, 2020
0.1.0 Jan 27, 2020

#83 in Value formatting

21 downloads per month

MIT license

11KB
241 lines

rs-humanize

Crates.io docs.rs badge

This is a Rust port of go-humanize. Right now only humanize.Time is ported over but I plan to do the rest.

Time

This lets you take a DateTime<Utc> and spit it out in relative terms. For example, 12 seconds ago or 3 days from now.

Code example:

use rs-humanize::time;
use chrono::Utc;

println!("{}", time::format(Utc::now()));
println!("{}", time::format(Utc.ymd(2018, 2, 18).and_hms(8, 30, 0)));

Dependencies

~1MB
~15K SLoC