pub struct Datetime { /* private fields */ }
Expand description
A UTC date and time.
Implementations§
Source§impl Datetime
impl Datetime
pub const MIN: Datetime
pub const MAX: Datetime
pub const UNIX_EPOCH: Datetime
Sourcepub fn try_from_unix_micros(micros: i64) -> Result<Datetime, OutOfRangeError>
pub fn try_from_unix_micros(micros: i64) -> Result<Datetime, OutOfRangeError>
Convert microseconds since unix epoch into a datetime
pub fn try_from_micros(micros: i64) -> Result<Datetime, OutOfRangeError>
👎Deprecated since 0.5.0: use try_from_unix_micros instead
pub fn from_micros(micros: i64) -> Datetime
👎Deprecated since 0.5.0: use from_unix_micros instead
Sourcepub fn from_unix_micros(micros: i64) -> Datetime
pub fn from_unix_micros(micros: i64) -> Datetime
pub fn to_micros(self) -> i64
👎Deprecated since 0.5.0: use to_unix_micros instead
Sourcepub fn to_unix_micros(self) -> i64
pub fn to_unix_micros(self) -> i64
Convert datetime to microseconds since Unix Epoch
Trait Implementations§
Source§impl From<Datetime> for LocalDatetime
impl From<Datetime> for LocalDatetime
Source§fn from(d: Datetime) -> LocalDatetime
fn from(d: Datetime) -> LocalDatetime
Converts to this type from the input type.
Source§impl Ord for Datetime
impl Ord for Datetime
Source§impl PartialOrd for Datetime
impl PartialOrd for Datetime
Source§impl TryFrom<Datetime> for SystemTime
impl TryFrom<Datetime> for SystemTime
Source§impl TryFrom<SystemTime> for Datetime
impl TryFrom<SystemTime> for Datetime
Source§type Error = OutOfRangeError
type Error = OutOfRangeError
The type returned in the event of a conversion error.
impl Copy for Datetime
impl Eq for Datetime
impl StructuralPartialEq for Datetime
Auto Trait Implementations§
impl Freeze for Datetime
impl RefUnwindSafe for Datetime
impl Send for Datetime
impl Sync for Datetime
impl Unpin for Datetime
impl UnwindSafe for Datetime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more