epochs

Crates.ioepochs
lib.rsepochs
version0.2.4
sourcesrc
created_at2020-01-17 16:59:28.000684
updated_at2020-02-14 23:49:21.417437
descriptionConvert various epoch times to chrono::NaiveDateTime times.
homepage
repositoryhttps://github.com/oylenshpeegul/Epochs-rust
max_upload_size
id199409
size38,507
Tim Heaney (oylenshpeegul)

documentation

README

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:

Commit count: 35

cargo fmt