Skip to main content

Clock

Trait Clock 

Source
pub trait Clock:
    Send
    + Sync
    + 'static {
    // Required methods
    fn now_utc(&self) -> OffsetDateTime;
    fn now_in(&self, tz: &Tz) -> ZonedDateTime;
    fn today_in(&self, tz: &Tz) -> Date;
    fn now_unix_millis(&self) -> i64;
}
Expand description

Wall-clock readouts. Single port for “what time is it?” across all surfaces.

Required Methods§

Source

fn now_utc(&self) -> OffsetDateTime

Source

fn now_in(&self, tz: &Tz) -> ZonedDateTime

Source

fn today_in(&self, tz: &Tz) -> Date

Source

fn now_unix_millis(&self) -> i64

Implementors§