5 releases

Uses old Rust 2015

0.2.4 Feb 14, 2020
0.2.3 Jan 17, 2020
0.2.2 Jan 17, 2020
0.2.1 Jan 17, 2020
0.2.0 Jan 17, 2020

#328 in Date and time

Download history 42/week @ 2023-02-01 34/week @ 2023-02-08 41/week @ 2023-02-15 14/week @ 2023-02-22 12/week @ 2023-03-01 35/week @ 2023-03-08 25/week @ 2023-03-15 11/week @ 2023-03-22 17/week @ 2023-03-29 25/week @ 2023-04-05 35/week @ 2023-04-12 17/week @ 2023-04-19 23/week @ 2023-04-26 37/week @ 2023-05-03 29/week @ 2023-05-10 21/week @ 2023-05-17

122 downloads per month
Used in epochs-cli

MPL-2.0 license

22KB
310 lines

Epochs-rust

Convert various epoch times to chrono::NaiveDateTime times in Rust.

Add the following under dependencies in your Cargo.toml

epochs = "0.2"

Then this

$ cat src/main.rs 
fn main() {
    if let Some(ndt) = epochs::unix(1234567890) {
        println!("{:?}", ndt);
    }
    if let Some(ndt) = epochs::chrome(12879041490654321) {
        println!("{:?}", ndt);
    }
}

would produce this

$ cargo run
...
2009-02-13T23:31:30
2009-02-13T23:31:30.654321

See Also

This project was originally done in Perl. See the Time::Moment::Epoch web page for motivation.

There are also versions in:

Dependencies

~1MB
~16K SLoC