pub struct DateTime { /* private fields */ }Implementations
sourceimpl DateTime
impl DateTime
sourcepub fn now_utc() -> Self
pub fn now_utc() -> Self
Create a new DateTime with the current date and time in UTC.
assert!(DateTime::now_utc().year() >= 2022);pub fn hour(&self) -> usize
pub fn minute(&self) -> usize
pub fn second(&self) -> usize
pub fn day(&self) -> usize
pub fn year(&self) -> usize
pub fn month<'a>(&'a self) -> Month
pub fn weekday<'a>(&'a self) -> Weekday
Trait Implementations
sourceimpl From<SystemTime> for DateTime
impl From<SystemTime> for DateTime
sourcefn from(system_time: SystemTime) -> Self
fn from(system_time: SystemTime) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for DateTime
impl Send for DateTime
impl Sync for DateTime
impl Unpin for DateTime
impl UnwindSafe for DateTime
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more