Closed patchthecode closed 1 year ago
In the future, if anyone needs:
use chrono::{TimeZone, Utc, DateTime};
let your_epoch = Utc.with_ymd_and_hms(2014, 9, 1, 0, 0, 0);
let parts = decompose(id);
Utc.timestamp_nanos(your_epoch.timestamp_nanos_opt().unwrap() + parts.nanos_time())
After converting the generated id into ints components using the
decompose
function, i got thisHow do i convert
25938899355
in to a date? is this possible?