pub struct Time { /* private fields */ }Expand description
Time
Notes
- Leap years are calculated by Gregorian calendar.
- Range of days:
[1..31]. - Range of hours:
[0..23]. - Range of minutes, seconds:
[0..59]. - Range of GMT offsets:
[-12:00..+14:00](in seconds).
Implementations
sourceimpl Time
impl Time
sourcepub fn make(
year: Year,
month: Month,
day: Day,
hour: Hour,
minute: Minute,
second: Second,
gmt_offset: Option<GmtOffset>
) -> CrateResult<Self>
pub fn make(
year: Year,
month: Month,
day: Day,
hour: Hour,
minute: Minute,
second: Second,
gmt_offset: Option<GmtOffset>
) -> CrateResult<Self>
sourcepub const fn gmt_offset(&self) -> Option<GmtOffset>
pub const fn gmt_offset(&self) -> Option<GmtOffset>
sourcepub fn make_utc() -> CrateResult<Self>
pub fn make_utc() -> CrateResult<Self>
sourcepub fn try_into_utc(&self) -> CrateResult<Self>
pub fn try_into_utc(&self) -> CrateResult<Self>
sourcepub fn make_local() -> CrateResult<Self>
pub fn make_local() -> CrateResult<Self>
sourcepub fn try_into_local(&self) -> CrateResult<Self>
pub fn try_into_local(&self) -> CrateResult<Self>
sourcepub fn try_into_unix_seconds(&self) -> CrateResult<UnixSecond>
pub fn try_into_unix_seconds(&self) -> CrateResult<UnixSecond>
Trait Implementations
sourceimpl Ord for Time
impl Ord for Time
sourceimpl PartialOrd<Time> for Time
impl PartialOrd<Time> for Time
sourcefn partial_cmp(&self, other: &Time) -> Option<Ordering>
fn partial_cmp(&self, other: &Time) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl TryFrom<&SystemTime> for Time
impl TryFrom<&SystemTime> for Time
sourceimpl TryFrom<SystemTime> for Time
impl TryFrom<SystemTime> for Time
impl Eq for Time
impl StructuralEq for Time
Auto Trait Implementations
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin for Time
impl UnwindSafe for Time
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more