pub struct DateTime { /* private fields */ }Expand description
It encodes the value using a number of seconds from the Gregorian calendar era using a Decimal
and an optional timezone offset in minutes.
Implementations§
Source§impl DateTime
impl DateTime
pub const MAX: DateTime
pub const MIN: DateTime
pub fn new(timestamp: Timestamp) -> DateTime
pub fn timestamp(&self) -> Timestamp
pub fn from_be_bytes(bytes: [u8; 18]) -> DateTime
Sourcepub fn timezone(self) -> Option<DayTimeDuration>
pub fn timezone(self) -> Option<DayTimeDuration>
pub fn timezone_offset(self) -> Option<TimezoneOffset>
pub fn to_be_bytes(self) -> [u8; 18]
Sourcepub fn checked_sub(
self,
rhs: impl Into<DateTime>,
) -> Result<DayTimeDuration, ThinError>
pub fn checked_sub( self, rhs: impl Into<DateTime>, ) -> Result<DayTimeDuration, ThinError>
Returns Err in case of overflow (FODT0001).
Sourcepub fn checked_add_year_month_duration(
self,
rhs: impl Into<YearMonthDuration>,
) -> Result<DateTime, ThinError>
pub fn checked_add_year_month_duration( self, rhs: impl Into<YearMonthDuration>, ) -> Result<DateTime, ThinError>
op:add-yearMonthDuration-to-dateTime
Returns Err in case of overflow (FODT0001).
Sourcepub fn checked_add_day_time_duration(
self,
rhs: impl Into<Duration>,
) -> Result<DateTime, ThinError>
pub fn checked_add_day_time_duration( self, rhs: impl Into<Duration>, ) -> Result<DateTime, ThinError>
op:add-dayTimeDuration-to-dateTime
Returns Err in case of overflow (FODT0001).
Sourcepub fn checked_add_duration(
self,
rhs: impl Into<Duration>,
) -> Result<DateTime, ThinError>
pub fn checked_add_duration( self, rhs: impl Into<Duration>, ) -> Result<DateTime, ThinError>
op:add-yearMonthDuration-to-dateTime and op:add-dayTimeDuration-to-dateTime
Returns Err in case of overflow (FODT0001).
Sourcepub fn checked_sub_year_month_duration(
self,
rhs: impl Into<YearMonthDuration>,
) -> Result<DateTime, ThinError>
pub fn checked_sub_year_month_duration( self, rhs: impl Into<YearMonthDuration>, ) -> Result<DateTime, ThinError>
op:subtract-yearMonthDuration-from-dateTime
Returns Err in case of overflow (FODT0001).
Sourcepub fn checked_sub_day_time_duration(
self,
rhs: impl Into<DayTimeDuration>,
) -> Result<DateTime, ThinError>
pub fn checked_sub_day_time_duration( self, rhs: impl Into<DayTimeDuration>, ) -> Result<DateTime, ThinError>
op:subtract-dayTimeDuration-from-dateTime
Returns Err in case of overflow (FODT0001).
Sourcepub fn checked_sub_duration(
self,
rhs: impl Into<Duration>,
) -> Result<DateTime, ThinError>
pub fn checked_sub_duration( self, rhs: impl Into<Duration>, ) -> Result<DateTime, ThinError>
op:subtract-yearMonthDuration-from-dateTime and op:subtract-dayTimeDuration-from-dateTime
Returns Err in case of overflow (FODT0001).
Sourcepub fn adjust(
self,
timezone_offset: Option<TimezoneOffset>,
) -> Result<DateTime, ThinError>
pub fn adjust( self, timezone_offset: Option<TimezoneOffset>, ) -> Result<DateTime, ThinError>
fn:adjust-dateTime-to-timezone
Returns Err in case of overflow (FODT0001).
Sourcepub fn is_identical_with(self, other: DateTime) -> bool
pub fn is_identical_with(self, other: DateTime) -> bool
Checks if the two values are identical.
Trait Implementations§
Source§impl<'data> From<DateTime> for TypedValueRef<'data>
impl<'data> From<DateTime> for TypedValueRef<'data>
Source§fn from(value: DateTime) -> TypedValueRef<'data>
fn from(value: DateTime) -> TypedValueRef<'data>
Source§impl PartialOrd for DateTime
impl PartialOrd for DateTime
Source§impl TryFrom<DateTime> for GYearMonth
Conversion according to XPath cast rules.
impl TryFrom<DateTime> for GYearMonth
Conversion according to XPath cast rules.
Source§type Error = DateTimeOverflowError
type Error = DateTimeOverflowError
Source§fn try_from(
date_time: DateTime,
) -> Result<GYearMonth, <GYearMonth as TryFrom<DateTime>>::Error>
fn try_from( date_time: DateTime, ) -> Result<GYearMonth, <GYearMonth as TryFrom<DateTime>>::Error>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more