Trait datetime::DatePiece[][src]

pub trait DatePiece {
    fn year(&self) -> i64;
fn month(&self) -> Month;
fn day(&self) -> i8;
fn yearday(&self) -> i16;
fn weekday(&self) -> Weekday; fn year_of_century(&self) -> i64 { ... }
fn years_from_2000(&self) -> i64 { ... } }

The date piece trait is used for date and time values that have date components of years, months, and days.

Required methods

fn year(&self) -> i64[src]

The year, in absolute terms. This is in human-readable format, so the year 2014 actually has a year value of 2014, rather than 14 or 114 or anything like that.

fn month(&self) -> Month[src]

The month of the year.

fn day(&self) -> i8[src]

The day of the month, from 1 to 31.

fn yearday(&self) -> i16[src]

The day of the year, from 1 to 366.

fn weekday(&self) -> Weekday[src]

The day of the week.

Loading content...

Provided methods

fn year_of_century(&self) -> i64[src]

The number of years into the century. This is the same as the last two digits of the year.

fn years_from_2000(&self) -> i64[src]

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).

Loading content...

Implementors

impl DatePiece for LocalDate[src]

impl DatePiece for LocalDateTime[src]

impl DatePiece for OffsetDateTime[src]

impl<'a> DatePiece for ZonedDateTime<'a>[src]

Loading content...