pub trait SystemTimeExt {
// Required methods
fn epoch(&self) -> Duration;
fn epoch_millis(&self) -> u64;
}
Expand description
Extension trait to add methods to std::time::SystemTime
Required Methods§
Sourcefn epoch(&self) -> Duration
fn epoch(&self) -> Duration
Returns the duration since the Unix epoch.
Panics if the system time is before the Unix epoch.
Sourcefn epoch_millis(&self) -> u64
fn epoch_millis(&self) -> u64
Returns the number of milliseconds (rounded down) since the Unix epoch.
Panics if the system time is before the Unix epoch.
Saturates at u64::MAX
.