Crates.io | geotime |
lib.rs | geotime |
version | 0.0.6 |
source | src |
created_at | 2023-01-14 21:16:49.266525 |
updated_at | 2023-01-15 02:49:13.784573 |
description | Provides signed 128-bit timestamps that are compatible with Unix time_t and anchored at the Unix epoch. |
homepage | |
repository | https://github.com/emwalker/geotime |
max_upload_size | |
id | 759043 |
size | 25,884 |
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");