Trait Clock

Source
pub trait Clock: Send + Sync {
    // Required methods
    fn local(&self) -> DateTime<Local>;
    fn utc(&self) -> DateTime<Utc>;
}
Expand description

A trait for getting the current time.

This is supported on feature=clock only.

Example.

Required Methods§

Source

fn local(&self) -> DateTime<Local>

Returns the current time in the local timezone.

Source

fn utc(&self) -> DateTime<Utc>

Returns the current time in UTC.

Implementors§