pub struct DateTime {
pub date_time: NaiveDateTime,
pub offset: Option<FixedOffset>,
}
Fields§
§date_time: NaiveDateTime
§offset: Option<FixedOffset>
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
Sourcepub fn earliest(&self) -> DateTime<FixedOffset>
pub fn earliest(&self) -> DateTime<FixedOffset>
Returns the earliest date/time with offset represented by this date/time.
Sourcepub fn latest(&self) -> DateTime<FixedOffset>
pub fn latest(&self) -> DateTime<FixedOffset>
Returns the latest date/time with offset represented by this date/time.
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 PartialOrd for DateTime
impl PartialOrd for DateTime
Source§impl TryFrom<DateTime> for DateTime<FixedOffset>
impl TryFrom<DateTime> for DateTime<FixedOffset>
Source§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>
Source§type Error = TimezoneError
type Error = TimezoneError
The type returned in the event of a conversion error.
impl Copy for DateTime
impl Eq 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