Type Alias irox_time::epoch::UnixTimestamp

source ·
pub type UnixTimestamp = Timestamp<UnixEpoch>;
Expand description

Represents a duration offset from the UNIX_EPOCH.

Aliased Type§

struct UnixTimestamp { /* private fields */ }

Implementations§

source§

impl UnixTimestamp

source

pub fn now() -> UnixTimestamp

Returns the local system clock equivalent of the unix timestamp

source

pub fn elapsed(&self) -> Duration

Returns the local system clock duration since the timestamp. MAY BE NEGATIVE if the clock has changed since the last call.

source

pub fn as_date(&self) -> Date

Returns this timestamp as a Date

source§

impl UnixTimestamp

source

pub const fn from_offset(offset: Duration) -> UnixTimestamp

Creates a new timestamp given the specified offset

source

pub const fn from_seconds(seconds: u32) -> UnixTimestamp

Creates a new timestamp given the specified number of seconds

source

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

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<&Date> for UnixTimestamp

source§

fn from(value: &Date) -> Self

Converts to this type from the input type.
source§

impl From<&UTCDateTime> for UnixTimestamp

source§

fn from(value: &UTCDateTime) -> Self

Converts to this type from the input type.
source§

impl From<Duration> for UnixTimestamp

source§

fn from(value: Duration) -> Self

Converts to this type from the input type.
source§

impl From<JulianDayNumber<JulianEpoch>> for UnixTimestamp

source§

fn from(value: JulianDate) -> Self

Converts to this type from the input type.
source§

impl From<UTCDateTime> for UnixTimestamp

source§

fn from(value: UTCDateTime) -> Self

Converts to this type from the input type.
source§

impl<T> FromTimestamp<T> for UnixTimestamp

source§

fn from_timestamp(other: &Timestamp<T>) -> Self