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<Self>
pub fn new(hour: u8, minute: u8, second: u8) -> Option<Self>
A validated time (hour 0–23, minute/second 0–59); None otherwise.
Sourcepub fn now() -> Self
pub fn now() -> Self
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) -> Self
pub fn from_seconds_of_day(secs: i64) -> Self
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§
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