[][src]Struct datetime::LocalTime

pub struct LocalTime { /* fields omitted */ }

A local time is a time on the timeline that recurs once a day, without a time zone.

Implementations

impl LocalTime[src]

pub fn from_seconds_since_midnight(seconds: i64) -> Self[src]

Computes the number of hours, minutes, and seconds, based on the number of seconds that have elapsed since midnight.

pub fn from_seconds_and_milliseconds_since_midnight(
    seconds: i64,
    millisecond_of_second: i16
) -> Self
[src]

Computes the number of hours, minutes, and seconds, based on the number of seconds that have elapsed since midnight.

pub fn midnight() -> Self[src]

Returns the time at midnight, with all fields initialised to 0.

pub fn hm(hour: i8, minute: i8) -> Result<Self, Error>[src]

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.

pub fn hms(hour: i8, minute: i8, second: i8) -> Result<Self, Error>[src]

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.

pub fn hms_ms(
    hour: i8,
    minute: i8,
    second: i8,
    millisecond: i16
) -> Result<Self, Error>
[src]

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.

pub fn to_seconds(self) -> i64[src]

Calculate the number of seconds since midnight this time is at, ignoring milliseconds.

Trait Implementations

impl Clone for LocalTime[src]

impl Copy for LocalTime[src]

impl Debug for LocalTime[src]

impl Eq for LocalTime[src]

impl FromStr for LocalTime[src]

type Err = Error<DateTimeError>

The associated error which can be returned from parsing.

impl ISO for LocalTime[src]

impl Ord for LocalTime[src]

impl PartialEq<LocalTime> for LocalTime[src]

impl PartialOrd<LocalTime> for LocalTime[src]

impl StructuralEq for LocalTime[src]

impl StructuralPartialEq for LocalTime[src]

impl TimePiece for LocalTime[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.