#epoch #google-calendar #30 #windows-file

epochs

Convert various epoch times to chrono::NaiveDateTime times

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

#535 in Date and time

Download history 45/week @ 2025-01-07 61/week @ 2025-01-14 14/week @ 2025-01-21 230/week @ 2025-01-28 42/week @ 2025-02-04 28/week @ 2025-02-11 29/week @ 2025-02-18 21/week @ 2025-02-25 8/week @ 2025-03-04 33/week @ 2025-03-11 57/week @ 2025-03-18 21/week @ 2025-03-25 26/week @ 2025-04-01 47/week @ 2025-04-08 37/week @ 2025-04-15 29/week @ 2025-04-22

142 downloads per month
Used in 6 crates (3 directly)

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
~18K SLoC