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>
Available on crate feature std only.
pub fn make_utc() -> CrateResult<Self>
std only.§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>
Available on crate features std and libc only.
pub fn make_local() -> CrateResult<Self>
std and libc only.§Makes current local time
Sourcepub fn try_into_local(&self) -> CrateResult<Self>
Available on crate feature libc only.
pub fn try_into_local(&self) -> CrateResult<Self>
libc only.§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 PartialOrd for Time
impl PartialOrd for Time
Source§impl TryFrom<&SystemTime> for Time
Available on crate feature std only.
impl TryFrom<&SystemTime> for Time
Available on crate feature
std only.Source§impl TryFrom<SystemTime> for Time
Available on crate feature std only.
impl TryFrom<SystemTime> for Time
Available on crate feature
std only.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