Struct datetime::LocalTime
[−]
[src]
pub struct LocalTime { /* fields omitted */ }
A local time is a time on the timeline that recurs once a day, without a time zone.
Methods
impl LocalTime
[src]
fn from_seconds_since_midnight(seconds: i64) -> LocalTime
Computes the number of hours, minutes, and seconds, based on the number of seconds that have elapsed since midnight.
fn from_seconds_and_milliseconds_since_midnight(
seconds: i64,
millisecond_of_second: i16
) -> LocalTime
seconds: i64,
millisecond_of_second: i16
) -> LocalTime
Computes the number of hours, minutes, and seconds, based on the number of seconds that have elapsed since midnight.
fn midnight() -> LocalTime
Returns the time at midnight, with all fields initialised to 0.
fn hm(hour: i8, minute: i8) -> Result<LocalTime, Error>
Creates a new timestamp instance with the given hour and minute fields. The second and millisecond fields are set to 0.
The values are checked for validity before instantiation, and
passing in values out of range will return an Err
.
fn hms(hour: i8, minute: i8, second: i8) -> Result<LocalTime, Error>
Creates a new timestamp instance with the given hour, minute, and second fields. The millisecond field is set to 0.
The values are checked for validity before instantiation, and
passing in values out of range will return an Err
.
fn hms_ms(
hour: i8,
minute: i8,
second: i8,
millisecond: i16
) -> Result<LocalTime, Error>
hour: i8,
minute: i8,
second: i8,
millisecond: i16
) -> Result<LocalTime, Error>
Creates a new timestamp instance with the given hour, minute, second, and millisecond fields.
The values are checked for validity before instantiation, and
passing in values out of range will return an Err
.
fn to_seconds(&self) -> i64
Calculate the number of seconds since midnight this time is at, ignoring milliseconds.
Trait Implementations
impl PartialEq for LocalTime
[src]
fn eq(&self, __arg_0: &LocalTime) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &LocalTime) -> bool
This method tests for !=
.
impl Eq for LocalTime
[src]
impl PartialOrd for LocalTime
[src]
fn partial_cmp(&self, __arg_0: &LocalTime) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &LocalTime) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &LocalTime) -> 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: &LocalTime) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &LocalTime) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for LocalTime
[src]
fn cmp(&self, __arg_0: &LocalTime) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl Clone for LocalTime
[src]
fn clone(&self) -> LocalTime
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 Copy for LocalTime
[src]
impl TimePiece for LocalTime
[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.