pub struct DayTime {
pub hour: u8,
pub minute: u8,
pub second: u8,
}Expand description
A civil (zoneless) wall-clock time. Display and DayTime::parse_iso speak ISO-8601
(HH:MM, or HH:MM:SS when seconds are nonzero).
Fields§
§hour: u8§minute: u8§second: u8Implementations§
Source§impl DayTime
impl DayTime
Sourcepub fn new(hour: u8, minute: u8, second: u8) -> Option<DayTime>
pub fn new(hour: u8, minute: u8, second: u8) -> Option<DayTime>
A validated time (hour 0–23, minute/second 0–59); None otherwise.
Sourcepub fn now() -> DayTime
pub fn now() -> DayTime
The current time of day from the system clock in UTC, the twin of DayDate::today,
and carrying the same caveat: Day ships no time-zone database, so an app that needs local
wall-clock time should apply its own offset. Pair the two for a timestamp
(Day-Showcase-2026-08-12-14-23-05.png).
Sourcepub fn seconds_of_day(self) -> i64
pub fn seconds_of_day(self) -> i64
Seconds since midnight, the numeric interchange form across native boundaries.
Sourcepub fn from_seconds_of_day(secs: i64) -> DayTime
pub fn from_seconds_of_day(secs: i64) -> DayTime
The time secs after midnight (inverse of DayTime::seconds_of_day; out-of-range wraps
into the day).
Trait Implementations§
impl Copy for DayTime
impl Eq for DayTime
Source§impl Ord for DayTime
impl Ord for DayTime
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for DayTime
impl PartialOrd for DayTime
impl StructuralPartialEq for DayTime
Auto Trait Implementations§
impl Freeze for DayTime
impl RefUnwindSafe for DayTime
impl Send for DayTime
impl Sync for DayTime
impl Unpin for DayTime
impl UnsafeUnpin for DayTime
impl UnwindSafe for DayTime
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more