pub struct DateTime {
pub year: i64,
pub month: u8,
pub day: u8,
pub hour: u8,
pub minute: u8,
pub second: u8,
}Expand description
A broken down date and time in the proleptic Gregorian calendar.
The fields must hold the values of their names (month 1 to 12, and so on);
see DateTime::is_valid. Conversions do not check them.
Fields§
§year: i64The year, for example 2026.
month: u8The month of the year, 1 to 12.
day: u8The day of the month, 1 to 31.
hour: u8The hour of the day, 0 to 23.
minute: u8The minute of the hour, 0 to 59.
second: u8The second of the minute, 0 to 59. Leap seconds are not represented.
Implementations§
Trait Implementations§
Source§impl Ord for DateTime
impl Ord for DateTime
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for DateTime
impl PartialOrd for DateTime
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 UnsafeUnpin 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