pub trait DatePiece {
// Required methods
fn year(&self) -> i64;
fn month(&self) -> Month;
fn day(&self) -> i8;
fn yearday(&self) -> i16;
fn weekday(&self) -> Weekday;
// Provided methods
fn year_of_century(&self) -> i64 { ... }
fn years_from_2000(&self) -> i64 { ... }
}Expand description
The date piece trait is used for date and time values that have date components of years, months, and days.
Required Methods§
Provided Methods§
Sourcefn year_of_century(&self) -> i64
fn year_of_century(&self) -> i64
The number of years into the century. This is the same as the last two digits of the year.
Sourcefn years_from_2000(&self) -> i64
fn years_from_2000(&self) -> i64
The year number, relative to the year 2000. Internally, many routines use years relative the year 2000, rather than the year 0 (well, 1 BCE).