Struct etwin_core::core::Instant
source · pub struct Instant(_);
Expand description
A point in time, with a millisecond precision.
Implementations§
source§impl Instant
impl Instant
sourcepub fn new_round_down(inner: DateTime<Utc>) -> Self
pub fn new_round_down(inner: DateTime<Utc>) -> Self
Round down nanosecond precision Chrono DateTime to to millisecond precision Instant.
pub fn ymd_hms( year: i32, month: u32, day: u32, hour: u32, min: u32, sec: u32 ) -> Self
pub fn ymd_hms_milli( year: i32, month: u32, day: u32, hour: u32, min: u32, sec: u32, milli: u32 ) -> Self
sourcepub fn from_posix_timestamp(secs: i64) -> Self
pub fn from_posix_timestamp(secs: i64) -> Self
Create an Instant from the number of POSIX seconds since 1970-01-01T00:00:00Z.
Note: POSIX seconds are defined as 1/86400 of a day (they ignore leap seconds).
pub fn into_chrono(self) -> DateTime<Utc>
pub fn into_posix_timestamp(self) -> i64
Trait Implementations§
source§impl Ord for Instant
impl Ord for Instant
source§impl PartialEq<Instant> for Instant
impl PartialEq<Instant> for Instant
source§impl PartialOrd<Instant> for Instant
impl PartialOrd<Instant> for Instant
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more