pub struct Date { /* private fields */ }
Expand description
A date, written as a text string.
A field is only respected if all superior fields are supplied. For example,
to set the minute, the hour, day, etc. have to be set. Similarly, in order
for the time zone information to be written, all time information (including
seconds) must be written. utc_offset_minute
is optional if supplying time
zone info. It must only be used to specify sub-hour time zone offsets.
Implementations§
source§impl Date
impl Date
sourcepub fn new(year: u16) -> Self
pub fn new(year: u16) -> Self
Create a new, minimal date. The year will be clamped within the range 0-9999.
sourcepub fn month(self, month: u8) -> Self
pub fn month(self, month: u8) -> Self
Add the month field. It will be clamped within the range 1-12.
sourcepub fn hour(self, hour: u8) -> Self
pub fn hour(self, hour: u8) -> Self
Add the hour field. It will be clamped within the range 0-23.
sourcepub fn minute(self, minute: u8) -> Self
pub fn minute(self, minute: u8) -> Self
Add the minute field. It will be clamped within the range 0-59.
sourcepub fn second(self, second: u8) -> Self
pub fn second(self, second: u8) -> Self
Add the second field. It will be clamped within the range 0-59.
sourcepub fn utc_offset_hour(self, hour: i8) -> Self
pub fn utc_offset_hour(self, hour: i8) -> Self
Add the offset from UTC in hours. If not specified, the time will be assumed to be local to the viewer’s time zone. It will be clamped within the range -23-23.
sourcepub fn utc_offset_minute(self, minute: u8) -> Self
pub fn utc_offset_minute(self, minute: u8) -> Self
Add the offset from UTC in minutes. This will have the same sign as set in
Self::utc_offset_hour
. It will be clamped within the range 0-59.
Trait Implementations§
impl Copy for Date
impl Eq for Date
impl StructuralPartialEq for Date
Auto Trait Implementations§
impl Freeze for Date
impl RefUnwindSafe for Date
impl Send for Date
impl Sync for Date
impl Unpin for Date
impl UnwindSafe for Date
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)