Struct DateTime
pub struct DateTime { /* private fields */ }
The representation for a civil datetime used by the TZif implementation.
We don't use civil::DateTime here because we specifically
do not need to represent fractional seconds. This lets us easily represent
what we need in 8 bytes.
Moreover, we pack the fields into a single i64 to make comparisons
extremely cheap. This is especially useful since we do a binary search on
civil datetimes when determining the instant that corresponds to a civil
datetime.
Implementations
impl DateTime
const MIN: DateTime = _;The minimum civil datetime value.
const MAX: DateTime = _;The maximum civil datetime value.
const fn new(dt: DateTime) -> DateTimeCreates a new TZif civil datetime from jiff-core's standard civil datetime type.
Note that this completely ignores any fractional second component on the provided datetime.
const fn year(self) -> i16Returns the year component of this civil datetime.
const fn month(self) -> i8Returns the month component of this civil datetime.
const fn day(self) -> i8Returns the day component of this civil datetime.
const fn hour(self) -> i8Returns the hour component of this civil datetime.
const fn minute(self) -> i8Returns the minute component of this civil datetime.
const fn second(self) -> i8Returns the second component of this civil datetime.
Trait Implementations
impl Clone for DateTime
fn clone(&self) -> Self
impl Copy for DateTime
impl Debug for DateTime
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for DateTime
impl From<DateTime> for DateTime
fn from(dt: DateTime) -> DateTime
impl Hash for DateTime
fn hash<__H: Hasher>(&self, state: &mut __H)
impl Ord for DateTime
fn cmp(&self, other: &Self) -> Ordering
impl PartialEq for DateTime
fn eq(&self, other: &Self) -> bool
impl PartialOrd for DateTime
fn partial_cmp(&self, other: &Self) -> Option<Ordering>