pub struct Datetime {
pub year: i32,
pub month: u32,
pub day: u32,
pub hour: u32,
pub minute: u32,
pub second: u32,
pub nanosecond: u32,
pub offset_seconds: i32,
}
Expand description
Representation of a date, time and timezone.
Fields
year: i32
The year, e.g. 2021.
month: u32
The month, 1=January.
day: u32
The day of the month.
hour: u32
The hour. 0-23
minute: u32
The minute. 0-59.
second: u32
The second. 0-60.
nanosecond: u32
The nanosecond part of the time.
offset_seconds: i32
The timezone offset from UTC in seconds. Negative for west, positive for east of UTC.
Trait Implementations
sourceimpl From<DateTime<FixedOffset>> for Datetime
impl From<DateTime<FixedOffset>> for Datetime
sourcefn from(dt: DateTime<FixedOffset>) -> Datetime
fn from(dt: DateTime<FixedOffset>) -> Datetime
Converts to this type from the input type.
impl Eq for Datetime
impl StructuralEq for Datetime
impl StructuralPartialEq for Datetime
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more