pub struct LocalTime { /* private fields */ }Expand description
A local time is a time on the timeline that recurs once a day, without a time zone.
Implementations§
Source§impl LocalTime
impl LocalTime
Sourcepub fn from_seconds_since_midnight(seconds: i64) -> Self
pub fn from_seconds_since_midnight(seconds: i64) -> Self
Computes the number of hours, minutes, and seconds, based on the number of seconds that have elapsed since midnight.
Sourcepub fn from_seconds_and_milliseconds_since_midnight(
seconds: i64,
millisecond_of_second: i16,
) -> Self
pub fn from_seconds_and_milliseconds_since_midnight( seconds: i64, millisecond_of_second: i16, ) -> Self
Computes the number of hours, minutes, and seconds, based on the number of seconds that have elapsed since midnight.
Sourcepub fn hm(hour: i8, minute: i8) -> Result<Self, Error>
pub fn hm(hour: i8, minute: i8) -> Result<Self, 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.
Sourcepub fn hms(hour: i8, minute: i8, second: i8) -> Result<Self, Error>
pub fn hms(hour: i8, minute: i8, second: i8) -> Result<Self, 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.
Sourcepub fn hms_ms(
hour: i8,
minute: i8,
second: i8,
millisecond: i16,
) -> Result<Self, Error>
pub fn hms_ms( hour: i8, minute: i8, second: i8, millisecond: i16, ) -> Result<Self, 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.
Sourcepub fn to_seconds(self) -> i64
pub fn to_seconds(self) -> i64
Calculate the number of seconds since midnight this time is at, ignoring milliseconds.