Struct datetime::LocalDateTime
[−]
[src]
pub struct LocalDateTime {
// some fields omitted
}A local date-time is an exact instant on the timeline, without a time zone.
Methods
impl LocalDateTime[src]
fn from_instant(instant: Instant) -> LocalDateTime
Computes a complete date-time based on the values in the given Instant parameter.
fn at(seconds_since_1970_epoch: i64) -> LocalDateTime
Computes a complete date-time based on the number of seconds that have elapsed since midnight, 1st January, 1970, setting the number of milliseconds to 0.
fn at_ms(seconds_since_1970_epoch: i64, millisecond_of_second: i16) -> LocalDateTime
Computes a complete date-time based on the number of seconds that have elapsed since midnight, 1st January, 1970,
fn new(date: LocalDate, time: LocalTime) -> LocalDateTime
Creates a new local date time from a local date and a local time.
fn date(&self) -> LocalDate
Returns the date portion of this date-time stamp.
fn time(&self) -> LocalTime
Returns the time portion of this date-time stamp.
fn now() -> LocalDateTime
Creates a new date-time stamp set to the current time.
fn to_instant(&self) -> Instant
fn add_seconds(&self, seconds: i64) -> LocalDateTime
Trait Implementations
impl Copy for LocalDateTime[src]
impl Clone for LocalDateTime[src]
fn clone(&self) -> LocalDateTime
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more
impl Ord for LocalDateTime[src]
fn cmp(&self, __arg_0: &LocalDateTime) -> Ordering
This method returns an Ordering between self and other. Read more
impl PartialOrd for LocalDateTime[src]
fn partial_cmp(&self, __arg_0: &LocalDateTime) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, __arg_0: &LocalDateTime) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, __arg_0: &LocalDateTime) -> bool
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, __arg_0: &LocalDateTime) -> bool
This method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, __arg_0: &LocalDateTime) -> bool
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl Eq for LocalDateTime[src]
impl PartialEq for LocalDateTime[src]
fn eq(&self, __arg_0: &LocalDateTime) -> bool
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &LocalDateTime) -> bool
This method tests for !=.
impl DatePiece for LocalDateTime[src]
fn year(&self) -> i64
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. Read more
fn month(&self) -> Month
The month of the year.
fn day(&self) -> i8
The day of the month, from 1 to 31.
fn yearday(&self) -> i16
The day of the year, from 1 to 366.
fn weekday(&self) -> Weekday
The day of the week.
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. Read more
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). Read more
impl TimePiece for LocalDateTime[src]
fn hour(&self) -> i8
The hour of the day.
fn minute(&self) -> i8
The minute of the hour.
fn second(&self) -> i8
The second of the minute.
fn millisecond(&self) -> i16
The millisecond of the second.
impl Debug for LocalDateTime[src]
impl Add<Duration> for LocalDateTime[src]
type Output = LocalDateTime
The resulting type after applying the + operator
fn add(self, duration: Duration) -> LocalDateTime
The method for the + operator
impl Sub<Duration> for LocalDateTime[src]
type Output = LocalDateTime
The resulting type after applying the - operator
fn sub(self, duration: Duration) -> LocalDateTime
The method for the - operator