pub trait DateTimeExt: Sized {
// Required methods
fn format_yyyy_mm_dd_hh_mm_ss(&self) -> String;
fn format_yyyy_mm_dd_hh_mm_ss_ns(&self) -> String;
fn parse_yyyy_mm_dd_hh_mm_ss(value: &str) -> Result<Self, Error>;
fn parse_yyyy_mm_dd_hh_mm_ss_ns(value: &str) -> Result<Self, Error>;
fn unix_seconds(&self) -> i64;
fn unix_nanoseconds(&self) -> i64;
fn from_unix_seconds(value: i64) -> Self;
fn from_unix_nanoseconds(value: i128) -> Self;
}Expand description
Extension trait for date times
Required Methods§
Sourcefn format_yyyy_mm_dd_hh_mm_ss(&self) -> String
fn format_yyyy_mm_dd_hh_mm_ss(&self) -> String
Formats as YYYY-MM-DD HH:MM:SS
Sourcefn format_yyyy_mm_dd_hh_mm_ss_ns(&self) -> String
fn format_yyyy_mm_dd_hh_mm_ss_ns(&self) -> String
Formats as YYYY-MM-DD HH:MM:SS.X
Sourcefn parse_yyyy_mm_dd_hh_mm_ss(value: &str) -> Result<Self, Error>
fn parse_yyyy_mm_dd_hh_mm_ss(value: &str) -> Result<Self, Error>
Parses from YYYY-MM-DD HH:MM:SS
Sourcefn parse_yyyy_mm_dd_hh_mm_ss_ns(value: &str) -> Result<Self, Error>
fn parse_yyyy_mm_dd_hh_mm_ss_ns(value: &str) -> Result<Self, Error>
Parses from YYYY-MM-DD HH:MM:SS.X
Sourcefn unix_seconds(&self) -> i64
fn unix_seconds(&self) -> i64
Returns the UNIX seconds
Sourcefn unix_nanoseconds(&self) -> i64
fn unix_nanoseconds(&self) -> i64
Returns the UNIX nanoseconds
Sourcefn from_unix_seconds(value: i64) -> Self
fn from_unix_seconds(value: i64) -> Self
Creates from UNIX seconds
Sourcefn from_unix_nanoseconds(value: i128) -> Self
fn from_unix_nanoseconds(value: i128) -> Self
Creates from UNIX nanoseconds
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.