pub struct UtcUnixSeconds(pub i64);Expand description
Unix-like seconds count in the UTC scale.
This is the standard POSIX timestamp — seconds since 1970-01-01T00:00:00 UTC,
with leap seconds folded (the 61st second 23:59:60 shares the same POSIX
value as the following 00:00:00).
Use LeapSeconds::utc_to_tai to convert
to TAI, or promote to UtcUnixNanos via .into().
§Example
use leap_sec::UtcUnixSeconds;
let utc = UtcUnixSeconds(1_700_000_000); // 2023-11-14 22:13:20 UTC
assert_eq!(format!("{utc}"), "1700000000 UTC");Tuple Fields§
§0: i64Trait Implementations§
Source§impl Clone for UtcUnixSeconds
impl Clone for UtcUnixSeconds
Source§fn clone(&self) -> UtcUnixSeconds
fn clone(&self) -> UtcUnixSeconds
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UtcUnixSeconds
impl Debug for UtcUnixSeconds
Source§impl Display for UtcUnixSeconds
Displays as "{seconds} UTC" (e.g., "1700000000 UTC").
impl Display for UtcUnixSeconds
Displays as "{seconds} UTC" (e.g., "1700000000 UTC").
Source§impl From<UtcUnixSeconds> for UtcUnixNanos
Lossless promotion: multiplies by 1,000,000,000.
impl From<UtcUnixSeconds> for UtcUnixNanos
Lossless promotion: multiplies by 1,000,000,000.
Source§fn from(s: UtcUnixSeconds) -> Self
fn from(s: UtcUnixSeconds) -> Self
Converts to this type from the input type.
Source§impl Hash for UtcUnixSeconds
impl Hash for UtcUnixSeconds
Source§impl Ord for UtcUnixSeconds
impl Ord for UtcUnixSeconds
Source§fn cmp(&self, other: &UtcUnixSeconds) -> Ordering
fn cmp(&self, other: &UtcUnixSeconds) -> Ordering
1.21.0 · 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 PartialEq for UtcUnixSeconds
impl PartialEq for UtcUnixSeconds
Source§impl PartialOrd for UtcUnixSeconds
impl PartialOrd for UtcUnixSeconds
impl Copy for UtcUnixSeconds
impl Eq for UtcUnixSeconds
impl StructuralPartialEq for UtcUnixSeconds
Auto Trait Implementations§
impl Freeze for UtcUnixSeconds
impl RefUnwindSafe for UtcUnixSeconds
impl Send for UtcUnixSeconds
impl Sync for UtcUnixSeconds
impl Unpin for UtcUnixSeconds
impl UnsafeUnpin for UtcUnixSeconds
impl UnwindSafe for UtcUnixSeconds
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