pub struct Date { /* private fields */ }Expand description
A civil date in the proleptic Gregorian calendar (ISO 8601).
Implementations§
Source§impl Date
impl Date
Sourcepub const fn new(year: i32, month: u8, day: u8) -> Option<Date>
pub const fn new(year: i32, month: u8, day: u8) -> Option<Date>
The date year-month-day; None unless the month is 1–12, the day
exists in that month, and |year| ≤ 999,999.
Sourcepub const fn days_since_epoch(self) -> i64
pub const fn days_since_epoch(self) -> i64
Days since 1970-01-01 (negative before it).
Sourcepub const fn from_days_since_epoch(days: i64) -> Option<Date>
pub const fn from_days_since_epoch(days: i64) -> Option<Date>
The date days after 1970-01-01; None past the year limit.
Trait Implementations§
impl Copy for Date
impl Eq for Date
Source§impl Ord for Date
impl Ord for Date
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Date
impl PartialOrd 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 UnsafeUnpin 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
Mutably borrows from an owned value. Read more