Struct datetime::LocalDateTime
[−]
[src]
pub struct LocalDateTime { /* 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
[src]
Computes a complete date-time based on the values in the given Instant parameter.
fn at(seconds_since_1970_epoch: i64) -> LocalDateTime
[src]
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
[src]
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
[src]
Creates a new local date time from a local date and a local time.
fn date(&self) -> LocalDate
[src]
Returns the date portion of this date-time stamp.
fn time(&self) -> LocalTime
[src]
Returns the time portion of this date-time stamp.
fn now() -> LocalDateTime
[src]
Creates a new date-time stamp set to the current time.
fn to_instant(&self) -> Instant
[src]
fn add_seconds(&self, seconds: i64) -> LocalDateTime
[src]
Trait Implementations
impl PartialEq for LocalDateTime
[src]
fn eq(&self, __arg_0: &LocalDateTime) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &LocalDateTime) -> bool
[src]
This method tests for !=
.
impl Eq for LocalDateTime
[src]
impl PartialOrd for LocalDateTime
[src]
fn partial_cmp(&self, __arg_0: &LocalDateTime) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &LocalDateTime) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &LocalDateTime) -> bool
[src]
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
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &LocalDateTime) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for LocalDateTime
[src]
fn cmp(&self, __arg_0: &LocalDateTime) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl Clone for LocalDateTime
[src]
fn clone(&self) -> LocalDateTime
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for LocalDateTime
[src]
impl DatePiece for LocalDateTime
[src]
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. Read more
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.
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. Read more
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). Read more
impl TimePiece for LocalDateTime
[src]
fn hour(&self) -> i8
[src]
The hour of the day.
fn minute(&self) -> i8
[src]
The minute of the hour.
fn second(&self) -> i8
[src]
The second of the minute.
fn millisecond(&self) -> i16
[src]
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
[src]
Performs the +
operation.
impl Sub<Duration> for LocalDateTime
[src]
type Output = LocalDateTime
The resulting type after applying the -
operator.
fn sub(self, duration: Duration) -> LocalDateTime
[src]
Performs the -
operation.