pub struct DateTime {
pub year: i32,
pub month: u8,
pub day: u8,
pub hour: u8,
pub minute: u8,
pub second: u8,
pub millisecond: u16,
pub offset: Offset,
}Fields§
§year: i32§month: u8§day: u8§hour: u8§minute: u8§second: u8§millisecond: u16§offset: OffsetImplementations§
Source§impl DateTime
impl DateTime
Sourcepub fn new(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
millisecond: u16,
) -> Self
pub fn new( year: i32, month: u8, day: u8, hour: u8, minute: u8, second: u8, millisecond: u16, ) -> Self
Returns a new DateTime object, where the offset is set to UTC.
Sourcepub fn new_with_offset(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
millisecond: u16,
offset: Offset,
) -> Self
pub fn new_with_offset( year: i32, month: u8, day: u8, hour: u8, minute: u8, second: u8, millisecond: u16, offset: Offset, ) -> Self
Returns a new DateTime object, where the offset is set by the user manually.
pub fn month(&self) -> Month
pub fn now() -> Self
pub const fn epoch() -> Self
pub fn now_utc() -> Self
Trait Implementations§
Source§impl Ord for DateTime
impl Ord for DateTime
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 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