Crates.io | crab_era |
lib.rs | crab_era |
version | 0.1.0 |
source | src |
created_at | 2022-04-15 00:26:01.794349 |
updated_at | 2022-04-15 00:26:01.794349 |
description | Computes time relative to the Crab Epoch (the commit of Rust 1.0, a59de37e) |
homepage | |
repository | https://github.com/ReactorScram/crab_era |
max_upload_size | |
id | 568181 |
size | 40,945 |
crab_era
computes time relative to the Crab Epoch (the commit of Rust 1.0, a59de37e).
Example:
use chrono::{
DateTime,
Utc,
};
use crab_era::{
crab,
to_crab,
};
let t_3339 = "2022-04-14T23:41:20+00:00";
let ndt = DateTime::parse_from_rfc3339 (t_3339).unwrap ().naive_utc ();
let c = to_crab (ndt);
let roundtripped = crab (c).unwrap ();
assert_eq! (c, 218406860);
assert_eq! (DateTime::<Utc>::from_utc (roundtripped, Utc).to_rfc3339 (), t_3339);
Made by 🦀 with 🦀 for 🦀 to 🦀