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§
source§impl 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>
§Makes new instance
sourcepub const fn gmt_offset(&self) -> Option<GmtOffset>
pub const fn gmt_offset(&self) -> Option<GmtOffset>
§GMT offset
sourcepub fn make_utc() -> CrateResult<Self>
pub fn make_utc() -> CrateResult<Self>
§Makes current time in UTC
sourcepub fn try_into_utc(&self) -> CrateResult<Self>
pub fn try_into_utc(&self) -> CrateResult<Self>
§Converts self into UTC time
sourcepub fn make_local() -> CrateResult<Self>
pub fn make_local() -> CrateResult<Self>
§Makes current local time
sourcepub fn try_into_local(&self) -> CrateResult<Self>
pub fn try_into_local(&self) -> CrateResult<Self>
§Converts self into local time
sourcepub fn try_into_unix_seconds(&self) -> CrateResult<UnixSecond>
pub fn try_into_unix_seconds(&self) -> CrateResult<UnixSecond>
§Converts self into Unix seconds
Trait Implementations§
source§impl Ord for Time
impl Ord for Time
source§impl PartialEq for Time
impl PartialEq for Time
source§impl PartialOrd for Time
impl PartialOrd for Time
1.0.0 · source§fn 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 moresource§impl TryFrom<&SystemTime> for Time
impl TryFrom<&SystemTime> for Time
source§impl TryFrom<SystemTime> for Time
impl TryFrom<SystemTime> for Time
impl Eq for Time
Auto Trait Implementations§
impl Freeze for Time
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin for Time
impl UnwindSafe for Time
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more