DateTime

Type Alias DateTime 

Source
pub type DateTime = DateTime<Utc>;
Expand description

DateTime type alias that uses either chrono or time depending on enabled features.

When the time feature is enabled, this is time::OffsetDateTime. When the chrono feature is enabled (and time is not), this is chrono::DateTime<Utc>.

Aliased Type§

pub struct DateTime { /* private fields */ }

Trait Implementations§

Source§

impl DateTimeExt for DateTime

Available on crate feature chrono and non-crate feature time only.
Source§

fn now() -> Self

Returns the current UTC datetime.
Source§

fn to_unix_timestamp(&self) -> i64

Returns the Unix timestamp (seconds since epoch).
Source§

fn from_unix_timestamp(secs: i64) -> Self

Creates a datetime from Unix timestamp (seconds since epoch).