pub struct DateTime(/* private fields */);
Expand description
A DateTime in the utc timezone
Implementations§
Source§impl DateTime
impl DateTime
pub fn new(secs: i64, ns: u32) -> Self
pub fn now() -> Self
pub fn from_std(time: SystemTime) -> Self
pub fn from_secs(secs: i64) -> Self
pub fn from_ms(ms: u64) -> Self
pub fn raw(&self) -> &DateTime<Utc>
pub fn raw_mut(&mut self) -> &mut DateTime<Utc>
pub fn into_raw(self) -> DateTime<Utc>
pub fn to_microsecs_since_2000(&self) -> i64
pub fn from_microsecs_since_2000(secs: i64) -> Self
pub fn to_iso8601(&self) -> String
pub fn to_date(&self) -> Date
pub fn parse_from_iso8601(s: &str) -> Result<Self, ParseError>
Sourcepub fn abs_diff(&self, other: &Self) -> Option<StdDuration>
pub fn abs_diff(&self, other: &Self) -> Option<StdDuration>
Returns None if the duration would overflow
Trait Implementations§
Source§impl ColumnType for DateTime
impl ColumnType for DateTime
fn column_kind() -> ColumnKind
fn to_data(&self) -> ColumnData<'_>
fn from_data(data: ColumnData<'_>) -> Result<Self, FromDataError>
Source§impl<'de> Deserialize<'de> for DateTime
impl<'de> Deserialize<'de> for DateTime
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for DateTime
impl Ord for DateTime
Source§impl PartialOrd for DateTime
impl PartialOrd for DateTime
impl Copy for DateTime
impl Eq for DateTime
impl StructuralPartialEq for DateTime
Auto Trait Implementations§
impl Freeze for DateTime
impl RefUnwindSafe for DateTime
impl Send for DateTime
impl Sync for DateTime
impl Unpin for DateTime
impl UnwindSafe for DateTime
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