UnixTimestamp

Type Alias UnixTimestamp 

Source
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

Source

pub fn as_date(&self) -> Date

Returns this timestamp as a Date

Source

pub fn as_julian(&self) -> JulianDate

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