pub struct GregorianTime { /* private fields */ }Expand description
UTC Civil calendar and time-of-day components of a Dt.
Implementations§
Source§impl GregorianTime
impl GregorianTime
Source§impl GregorianTime
impl GregorianTime
Sourcepub const fn new(
unix_attosec: i128,
yr: i64,
mo: u8,
day: u8,
hr: u8,
min: u8,
sec: u8,
attos: u64,
iso_yr: i64,
iso_wk: u8,
iso_wkday: Weekday,
day_of_yr: u16,
wkday: u8,
wk_of_yr_sun: u8,
wk_of_yr_mon: u8,
) -> Self
pub const fn new( unix_attosec: i128, yr: i64, mo: u8, day: u8, hr: u8, min: u8, sec: u8, attos: u64, iso_yr: i64, iso_wk: u8, iso_wkday: Weekday, day_of_yr: u16, wkday: u8, wk_of_yr_sun: u8, wk_of_yr_mon: u8, ) -> Self
Creates a new GregorianTime with all fields specified.
This isn’t the recommended way to make a GregorianTime.
It’s safer to use Dt::to_gregorian_time().
Sourcepub const fn unix_attosec(&self) -> i128
pub const fn unix_attosec(&self) -> i128
UNIX attoseconds since 1970 epoch
Sourcepub const fn unix_timestamp(&self) -> (i64, u64)
pub const fn unix_timestamp(&self) -> (i64, u64)
Returns the Unix timestamp since 1970-01-01 00:00:00 UTC as a tuple of
(whole_seconds, attoseconds).
whole_secondscan be negative (for dates before 1970).- The fractional part (
attoseconds) is always in the range0..=999_999_999_999_999_999.
Sourcepub const fn yr(&self) -> i64
pub const fn yr(&self) -> i64
Gregorian year (proleptic Gregorian calendar, supports negative years and year 0).
Sourcepub const fn attos(&self) -> u64
pub const fn attos(&self) -> u64
Fractional part of the second expressed in attoseconds (0 ≤ attos < 10¹⁸).
Sourcepub const fn wk_of_yr_sun(&self) -> u8
pub const fn wk_of_yr_sun(&self) -> u8
Sunday based week of year (Range: 0..=53).
Sourcepub const fn wk_of_yr_mon(&self) -> u8
pub const fn wk_of_yr_mon(&self) -> u8
Monday based week of year (Range: 0..=53).
pub const fn offset_sec(&self) -> Option<i32>
pub const fn tz(&self) -> Option<&AsciiStr<49>>
pub const fn tz_abbrev(&self) -> Option<&AsciiStr<49>>
Sourcepub const fn to_time_point(&self) -> Dt
pub const fn to_time_point(&self) -> Dt
Reconstructs a Dt from these UTC civil components.
Round-tripping with Dt::to_gregorian_time.
Trait Implementations§
Source§impl Clone for GregorianTime
impl Clone for GregorianTime
Source§fn clone(&self) -> GregorianTime
fn clone(&self) -> GregorianTime
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 GregorianTime
impl Debug for GregorianTime
Source§impl PartialEq for GregorianTime
impl PartialEq for GregorianTime
Source§fn eq(&self, other: &GregorianTime) -> bool
fn eq(&self, other: &GregorianTime) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for GregorianTime
impl Eq for GregorianTime
impl StructuralPartialEq for GregorianTime
Auto Trait Implementations§
impl Freeze for GregorianTime
impl RefUnwindSafe for GregorianTime
impl Send for GregorianTime
impl Sync for GregorianTime
impl Unpin for GregorianTime
impl UnsafeUnpin for GregorianTime
impl UnwindSafe for GregorianTime
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