pub struct UnixTimestamp(/* private fields */);
Implementations§
Source§impl UnixTimestamp
impl UnixTimestamp
pub const MIN: UnixTimestamp
pub const MAX: UnixTimestamp
pub fn now() -> Self
pub const fn checked_from_unix_timestamp(timestamp: i64) -> Option<Self>
pub const fn from_unix_timestamp(timestamp: i64) -> TimestampResult
pub const fn unix_timestamp(self) -> i64
pub const fn midnight(self) -> Self
pub const fn seconds_since_midnight(self) -> i64
pub const fn checked_add(self, seconds: i64) -> Option<Self>
pub const fn checked_sub(self, seconds: i64) -> Option<Self>
pub const fn saturating_add(self, seconds: i64) -> Self
pub const fn saturating_sub(self, seconds: i64) -> Self
pub const fn checked_from_year_month_day( year: u16, month: u8, day: u8, ) -> Option<Self>
pub const fn from_year_month_day( year: u16, month: u8, day: u8, ) -> TimestampResult
pub const fn to_year_month_day(self) -> (u16, u8, u8)
pub const fn checked_from_year_ordinal(year: u16, ordinal: u16) -> Option<Self>
pub const fn from_year_ordinal(year: u16, ordinal: u16) -> TimestampResult
pub const fn to_year_ordinal(self) -> (u16, u16)
pub const fn checked_from_julian_day_number( julian_day_number: i32, ) -> Option<Self>
pub const fn from_julian_day_number(julian_day_number: i32) -> TimestampResult
pub const fn julian_day_number(self) -> i32
pub const fn weekday(self) -> Weekday
Trait Implementations§
Source§impl Clone for UnixTimestamp
impl Clone for UnixTimestamp
Source§fn clone(&self) -> UnixTimestamp
fn clone(&self) -> UnixTimestamp
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for UnixTimestamp
impl Debug for UnixTimestamp
Source§impl From<SystemTime> for UnixTimestamp
impl From<SystemTime> for UnixTimestamp
Source§fn from(system_time: SystemTime) -> Self
fn from(system_time: SystemTime) -> Self
Converts to this type from the input type.
Source§impl From<UnixTimestamp> for SystemTime
impl From<UnixTimestamp> for SystemTime
Source§fn from(timestamp: UnixTimestamp) -> Self
fn from(timestamp: UnixTimestamp) -> Self
Converts to this type from the input type.
Source§impl PartialEq for UnixTimestamp
impl PartialEq for UnixTimestamp
Source§impl PartialOrd for UnixTimestamp
impl PartialOrd for UnixTimestamp
impl Copy for UnixTimestamp
impl StructuralPartialEq for UnixTimestamp
Auto Trait Implementations§
impl Freeze for UnixTimestamp
impl RefUnwindSafe for UnixTimestamp
impl Send for UnixTimestamp
impl Sync for UnixTimestamp
impl Unpin for UnixTimestamp
impl UnwindSafe for UnixTimestamp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more