pub struct UTC { /* private fields */ }Expand description
Coordinated Universal Time (UTC).
UTC is the primary civil time standard. It is kept within 0.9 seconds of UT1 (astronomical time based on Earth’s rotation) by the insertion of leap seconds.
Implementations§
Source§impl UTC
impl UTC
Sourcepub fn from_datetime(dt: &DateTime<Utc>) -> Self
pub fn from_datetime(dt: &DateTime<Utc>) -> Self
Create a UTC time from a chrono DateTime.
Sourcepub fn to_datetime(&self) -> DateTime<Utc>
pub fn to_datetime(&self) -> DateTime<Utc>
Convert to a chrono DateTime.
Sourcepub fn from_components(
year: i32,
month: u32,
day: u32,
hour: u32,
minute: u32,
second: f64,
) -> Self
pub fn from_components( year: i32, month: u32, day: u32, hour: u32, minute: u32, second: f64, ) -> Self
Create from year, month, day, hour, minute, second components.
Sourcepub fn unix_seconds(&self) -> f64
pub fn unix_seconds(&self) -> f64
Get the Unix seconds value.
Sourcepub fn add_seconds(&self, seconds: f64) -> Self
pub fn add_seconds(&self, seconds: f64) -> Self
Add seconds to the UTC time.
Trait Implementations§
impl Copy for UTC
impl StructuralPartialEq for UTC
Auto Trait Implementations§
impl Freeze for UTC
impl RefUnwindSafe for UTC
impl Send for UTC
impl Sync for UTC
impl Unpin for UTC
impl UnwindSafe for UTC
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