geotime

Crates.iogeotime
lib.rsgeotime
version0.0.6
sourcesrc
created_at2023-01-14 21:16:49.266525
updated_at2023-01-15 02:49:13.784573
descriptionProvides signed 128-bit timestamps that are compatible with Unix time_t and anchored at the Unix epoch.
homepage
repositoryhttps://github.com/emwalker/geotime
max_upload_size
id759043
size25,884
Eric Walker (emwalker)

documentation

https://docs.rs/geotime/latest/geotime/

README

Geotime

Geotime provides a 128-bit signed integer timestamp compatible with Unix time_t and anchored at the Unix epoch. See the documentation here.

use geotime::Geotime;

let dt = Geotime::from(0);
assert_eq!(dt.display_string("%Y-%m-%d"), "1970-01-01");

let dt = Geotime::from((i64::MAX as i128) + 1);
assert_eq!(dt.display_string("%Y"), "299.87 M years from now");

let dt = Geotime::from(-(i64::MAX as i128) * 100);
assert_eq!(dt.display_string("%Y"), "29.99 B years ago");
Commit count: 24

cargo fmt