pub type UnixTimestamp = Timestamp<UnixEpoch>;Expand description
Represents a duration offset from the UNIX_EPOCH.
Aliased Type§
pub struct UnixTimestamp { /* private fields */ }Implementations§
Source§impl UnixTimestamp
impl UnixTimestamp
Sourcepub fn now() -> UnixTimestamp
Available on crate feature std only.
pub fn now() -> UnixTimestamp
std only.Returns the local system clock equivalent of the unix timestamp
Sourcepub fn elapsed(&self) -> Duration
Available on crate feature std only.
pub fn elapsed(&self) -> Duration
std only.Returns the local system clock duration since the timestamp. MAY BE NEGATIVE if the clock has changed since the last call.
pub fn as_julian(&self) -> JulianDate
Source§impl UnixTimestamp
impl UnixTimestamp
Sourcepub const fn from_offset(offset: Duration) -> UnixTimestamp
pub const fn from_offset(offset: Duration) -> UnixTimestamp
Creates a new timestamp given the specified offset
Sourcepub const fn from_seconds(seconds: u32) -> UnixTimestamp
pub const fn from_seconds(seconds: u32) -> UnixTimestamp
Creates a new timestamp given the specified number of seconds
Sourcepub const fn from_seconds_f64(seconds: f64) -> UnixTimestamp
pub const fn from_seconds_f64(seconds: f64) -> UnixTimestamp
Creates a new timestamp given the specified number of fractional seconds
Trait Implementations§
Source§impl Default for UnixTimestamp
impl Default for UnixTimestamp
Source§impl<'de> Deserialize<'de> for UnixTimestamp
Available on crate feature serde only.
impl<'de> Deserialize<'de> for UnixTimestamp
Available on crate feature
serde only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&Date> for UnixTimestamp
impl From<&Date> for UnixTimestamp
Source§impl From<&UTCDateTime> for UnixTimestamp
impl From<&UTCDateTime> for UnixTimestamp
Source§fn from(value: &UTCDateTime) -> Self
fn from(value: &UTCDateTime) -> Self
Converts to this type from the input type.
Source§impl From<Duration> for UnixTimestamp
impl From<Duration> for UnixTimestamp
Source§impl From<JulianDayNumber<JulianEpoch>> for UnixTimestamp
impl From<JulianDayNumber<JulianEpoch>> for UnixTimestamp
Source§fn from(value: JulianDate) -> Self
fn from(value: JulianDate) -> Self
Converts to this type from the input type.
Source§impl From<UTCDateTime> for UnixTimestamp
impl From<UTCDateTime> for UnixTimestamp
Source§fn from(value: UTCDateTime) -> Self
fn from(value: UTCDateTime) -> Self
Converts to this type from the input type.