Skip to main content

split_epoch_seconds

Function split_epoch_seconds 

Source
pub fn split_epoch_seconds(epoch_seconds: i64) -> (i64, i64)
Expand description

Decomposes total (possibly negative) epoch_seconds into an (epoch_day, nanos_of_day) pair – div_euclid/rem_euclid, not plain //%, so a pre-1970 instant (negative epoch_seconds) still gets a nanos_of_day in 0..NANOS_PER_DAY (Rust’s % on a negative dividend returns a negative remainder, which would put the “same calendar day” one day off).