pub struct DateTime { /* private fields */ }Implementations§
source§impl DateTime
impl DateTime
pub fn new(date_time: NaiveDateTime, offset: Option<FixedOffset>) -> Self
sourcepub fn now_ms() -> Self
pub fn now_ms() -> Self
Returns a DateTime which corresponds to the current time and date,
with millisecond precision (at most).
pub fn into_string(self) -> String
Trait Implementations§
source§impl From<DateTime<FixedOffset>> for DateTime
impl From<DateTime<FixedOffset>> for DateTime
source§fn from(value: DateTime<FixedOffset>) -> Self
fn from(value: DateTime<FixedOffset>) -> Self
Converts to this type from the input type.
source§impl LexicalFormOf<DateTime> for DateTime
impl LexicalFormOf<DateTime> for DateTime
type ValueError = InvalidDateTimeValue
fn try_as_value(&self) -> Result<DateTime, Self::ValueError>
source§impl ParseXsd for DateTime
impl ParseXsd for DateTime
type LexicalForm = DateTime
fn parse_xsd(lexical_value: &str) -> ParseXsdResult<Self, Self::LexicalForm>
source§impl TryFrom<DateTime> for DateTime<FixedOffset>
impl TryFrom<DateTime> for DateTime<FixedOffset>
§type Error = MissingTimezone
type Error = MissingTimezone
The type returned in the event of a conversion error.
source§impl TryFrom<DateTime> for DateTime<Utc>
impl TryFrom<DateTime> for DateTime<Utc>
§type Error = TimezoneError
type Error = TimezoneError
The type returned in the event of a conversion error.
impl Copy for DateTime
Auto Trait Implementations§
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