Struct systemstat::data::UTC
[−]
[src]
pub struct UTC;
The UTC time zone. This is the most efficient time zone when you don't need the local time. It is also used as an offset (which is also a dummy type).
Using the TimeZone
methods
on the UTC struct is the preferred way to construct DateTime<UTC>
instances.
Example
use chrono::{DateTime, TimeZone, NaiveDateTime, UTC}; let dt = DateTime::<UTC>::from_utc(NaiveDateTime::from_timestamp(61, 0), UTC); assert_eq!(UTC.timestamp(61, 0), dt); assert_eq!(UTC.ymd(1970, 1, 1).and_hms(0, 1, 1), dt);
Methods
impl UTC
[src]
fn today() -> Date<UTC>
Returns a Date
which corresponds to the current date.
fn now() -> DateTime<UTC>
Returns a DateTime
which corresponds to the current date.
Trait Implementations
impl Display for UTC
[src]
impl Copy for UTC
[src]
impl Eq for UTC
[src]
impl Offset for UTC
[src]
fn fix(&self) -> FixedOffset
impl PartialEq<UTC> for UTC
[src]
fn eq(&self, __arg_0: &UTC) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl TimeZone for UTC
[src]
type Offset = UTC
fn from_offset(_state: &UTC) -> UTC
fn offset_from_local_date(&self, _local: &NaiveDate) -> LocalResult<UTC>
fn offset_from_local_datetime(&self, _local: &NaiveDateTime) -> LocalResult<UTC>
fn offset_from_utc_date(&self, _utc: &NaiveDate) -> UTC
fn offset_from_utc_datetime(&self, _utc: &NaiveDateTime) -> UTC
impl Debug for UTC
[src]
impl Clone for UTC
[src]
fn clone(&self) -> UTC
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more