Struct datetime_default::DateTimeDefaultUnix
source · [−]pub struct DateTimeDefaultUnix<Tz, const OFFSET_HOURS: i32 = 0>(_)
where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy;
Expand description
DateTime with UNIX epoch as default.
use chrono::{Utc, TimeZone};
use datetime_default::DateTimeDefaultUnix;
assert_eq!(
DateTimeDefaultUnix::<Utc>::default(),
Utc.datetime_from_str("1970/1/1 00:00:00", "%Y/%m/%d %H:%M:%S").unwrap()
);
Methods from Deref<Target = DateTime<Tz>>
sourcepub fn date(&self) -> Date<Tz>
pub fn date(&self) -> Date<Tz>
Retrieves a date component
Unless you are immediately planning on turning this into a DateTime
with the same Timezone you should use the
date_naive
method.
use chrono::prelude::*;
let date: Date<Utc> = Utc.ymd(2020, 1, 1);
let dt: DateTime<Utc> = date.and_hms(0, 0, 0);
assert_eq!(dt.date(), date);
assert_eq!(dt.date().and_hms(1, 1, 1), date.and_hms(1, 1, 1));
sourcepub fn date_naive(&self) -> NaiveDate
pub fn date_naive(&self) -> NaiveDate
Retrieves the Date without an associated timezone
NaiveDate
is a more well-defined type, and has more traits implemented on it,
so should be preferred to Date
any time you truly want to operate on Dates.
use chrono::prelude::*;
let date: DateTime<Utc> = Utc.ymd(2020, 1, 1).and_hms(0, 0, 0);
let other: DateTime<FixedOffset> = FixedOffset::east(23).ymd(2020, 1, 1).and_hms(0, 0, 0);
assert_eq!(date.date_naive(), other.date_naive());
sourcepub fn time(&self) -> NaiveTime
pub fn time(&self) -> NaiveTime
Retrieves a time component.
Unlike date
, this is not associated to the time zone.
sourcepub fn timestamp(&self) -> i64
pub fn timestamp(&self) -> i64
Returns the number of non-leap seconds since January 1, 1970 0:00:00 UTC (aka “UNIX timestamp”).
sourcepub fn timestamp_millis(&self) -> i64
pub fn timestamp_millis(&self) -> i64
Returns the number of non-leap-milliseconds since January 1, 1970 UTC
Note that this does reduce the number of years that can be represented from ~584 Billion to ~584 Million. (If this is a problem, please file an issue to let me know what domain needs millisecond precision over billions of years, I’m curious.)
Example
use chrono::Utc;
use chrono::TimeZone;
let dt = Utc.ymd(1970, 1, 1).and_hms_milli(0, 0, 1, 444);
assert_eq!(dt.timestamp_millis(), 1_444);
let dt = Utc.ymd(2001, 9, 9).and_hms_milli(1, 46, 40, 555);
assert_eq!(dt.timestamp_millis(), 1_000_000_000_555);
sourcepub fn timestamp_micros(&self) -> i64
pub fn timestamp_micros(&self) -> i64
Returns the number of non-leap-microseconds since January 1, 1970 UTC
Note that this does reduce the number of years that can be represented from ~584 Billion to ~584 Thousand. (If this is a problem, please file an issue to let me know what domain needs microsecond precision over millennia, I’m curious.)
Example
use chrono::Utc;
use chrono::TimeZone;
let dt = Utc.ymd(1970, 1, 1).and_hms_micro(0, 0, 1, 444);
assert_eq!(dt.timestamp_micros(), 1_000_444);
let dt = Utc.ymd(2001, 9, 9).and_hms_micro(1, 46, 40, 555);
assert_eq!(dt.timestamp_micros(), 1_000_000_000_000_555);
sourcepub fn timestamp_nanos(&self) -> i64
pub fn timestamp_nanos(&self) -> i64
Returns the number of non-leap-nanoseconds since January 1, 1970 UTC
Note that this does reduce the number of years that can be represented from ~584 Billion to ~584. (If this is a problem, please file an issue to let me know what domain needs nanosecond precision over millennia, I’m curious.)
Example
use chrono::Utc;
use chrono::TimeZone;
let dt = Utc.ymd(1970, 1, 1).and_hms_nano(0, 0, 1, 444);
assert_eq!(dt.timestamp_nanos(), 1_000_000_444);
let dt = Utc.ymd(2001, 9, 9).and_hms_nano(1, 46, 40, 555);
assert_eq!(dt.timestamp_nanos(), 1_000_000_000_000_000_555);
sourcepub fn timestamp_subsec_millis(&self) -> u32
pub fn timestamp_subsec_millis(&self) -> u32
Returns the number of milliseconds since the last second boundary
warning: in event of a leap second, this may exceed 999
note: this is not the number of milliseconds since January 1, 1970 0:00:00 UTC
sourcepub fn timestamp_subsec_micros(&self) -> u32
pub fn timestamp_subsec_micros(&self) -> u32
Returns the number of microseconds since the last second boundary
warning: in event of a leap second, this may exceed 999_999
note: this is not the number of microseconds since January 1, 1970 0:00:00 UTC
sourcepub fn timestamp_subsec_nanos(&self) -> u32
pub fn timestamp_subsec_nanos(&self) -> u32
Returns the number of nanoseconds since the last second boundary
warning: in event of a leap second, this may exceed 999_999_999
note: this is not the number of nanoseconds since January 1, 1970 0:00:00 UTC
sourcepub fn with_timezone<Tz2>(&self, tz: &Tz2) -> DateTime<Tz2>where
Tz2: TimeZone,
pub fn with_timezone<Tz2>(&self, tz: &Tz2) -> DateTime<Tz2>where
Tz2: TimeZone,
Changes the associated time zone.
The returned DateTime
references the same instant of time from the perspective of the provided time zone.
sourcepub fn naive_utc(&self) -> NaiveDateTime
pub fn naive_utc(&self) -> NaiveDateTime
Returns a view to the naive UTC datetime.
sourcepub fn naive_local(&self) -> NaiveDateTime
pub fn naive_local(&self) -> NaiveDateTime
Returns a view to the naive local datetime.
sourcepub fn years_since(&self, base: DateTime<Tz>) -> Option<u32>
pub fn years_since(&self, base: DateTime<Tz>) -> Option<u32>
Retrieve the elapsed years from now to the given DateTime
.
pub const MIN_UTC: DateTime<Utc> = DateTime{ datetime: NaiveDateTime::MIN, offset: Utc,}
pub const MAX_UTC: DateTime<Utc> = DateTime{ datetime: NaiveDateTime::MAX, offset: Utc,}
sourcepub fn to_rfc2822(&self) -> String
pub fn to_rfc2822(&self) -> String
Returns an RFC 2822 date and time string such as Tue, 1 Jul 2003 10:52:37 +0200
.
sourcepub fn to_rfc3339(&self) -> String
pub fn to_rfc3339(&self) -> String
Returns an RFC 3339 and ISO 8601 date and time string such as 1996-12-19T16:39:57-08:00
.
sourcepub fn to_rfc3339_opts(&self, secform: SecondsFormat, use_z: bool) -> String
pub fn to_rfc3339_opts(&self, secform: SecondsFormat, use_z: bool) -> String
Return an RFC 3339 and ISO 8601 date and time string with subseconds
formatted as per a SecondsFormat
.
If passed use_z
true and the timezone is UTC (offset 0), use ‘Z’, as
per Fixed::TimezoneOffsetColonZ
If passed use_z
false, use
Fixed::TimezoneOffsetColon
Examples
let dt = Utc.ymd(2018, 1, 26).and_hms_micro(18, 30, 9, 453_829);
assert_eq!(dt.to_rfc3339_opts(SecondsFormat::Millis, false),
"2018-01-26T18:30:09.453+00:00");
assert_eq!(dt.to_rfc3339_opts(SecondsFormat::Millis, true),
"2018-01-26T18:30:09.453Z");
assert_eq!(dt.to_rfc3339_opts(SecondsFormat::Secs, true),
"2018-01-26T18:30:09Z");
let pst = FixedOffset::east(8 * 60 * 60);
let dt = pst.ymd(2018, 1, 26).and_hms_micro(10, 30, 9, 453_829);
assert_eq!(dt.to_rfc3339_opts(SecondsFormat::Secs, true),
"2018-01-26T10:30:09+08:00");
sourcepub fn format_with_items<'a, I, B>(&self, items: I) -> DelayedFormat<I>where
I: Iterator<Item = B> + Clone,
B: Borrow<Item<'a>>,
pub fn format_with_items<'a, I, B>(&self, items: I) -> DelayedFormat<I>where
I: Iterator<Item = B> + Clone,
B: Borrow<Item<'a>>,
Formats the combined date and time with the specified formatting items.
sourcepub fn format(&self, fmt: &'a str) -> DelayedFormat<StrftimeItems<'a>>
pub fn format(&self, fmt: &'a str) -> DelayedFormat<StrftimeItems<'a>>
Formats the combined date and time with the specified format string.
See the crate::format::strftime
module
on the supported escape sequences.
Example
use chrono::prelude::*;
let date_time: DateTime<Utc> = Utc.ymd(2017, 04, 02).and_hms(12, 50, 32);
let formatted = format!("{}", date_time.format("%d/%m/%Y %H:%M"));
assert_eq!(formatted, "02/04/2017 12:50");
Trait Implementations
sourceimpl<Tz, const OFFSET_HOURS: i32> Add<Duration> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz, const OFFSET_HOURS: i32> Add<Duration> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
sourceimpl<Tz, const OFFSET_HOURS: i32> Add<FixedOffset> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz, const OFFSET_HOURS: i32> Add<FixedOffset> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
type Output = DateTimeDefaultUnix<Tz, OFFSET_HOURS>
type Output = DateTimeDefaultUnix<Tz, OFFSET_HOURS>
+
operator.sourcefn add(self, rhs: FixedOffset) -> Self::Output
fn add(self, rhs: FixedOffset) -> Self::Output
+
operation. Read moresourceimpl<Tz, const OFFSET_HOURS: i32> AddAssign<Duration> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz, const OFFSET_HOURS: i32> AddAssign<Duration> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
sourcefn add_assign(&mut self, rhs: Duration)
fn add_assign(&mut self, rhs: Duration)
+=
operation. Read moresourceimpl<Tz: Clone, const OFFSET_HOURS: i32> Clone for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz: Clone, const OFFSET_HOURS: i32> Clone for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
sourcefn clone(&self) -> DateTimeDefaultUnix<Tz, OFFSET_HOURS>
fn clone(&self) -> DateTimeDefaultUnix<Tz, OFFSET_HOURS>
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl<Tz, const OFFSET_HOURS: i32> Datelike for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz, const OFFSET_HOURS: i32> Datelike for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
sourcefn year(&self) -> i32
fn year(&self) -> i32
sourcefn with_year(&self, year: i32) -> Option<DateTimeDefaultUnix<Tz, OFFSET_HOURS>>
fn with_year(&self, year: i32) -> Option<DateTimeDefaultUnix<Tz, OFFSET_HOURS>>
sourcefn with_month(&self, month: u32) -> Option<DateTimeDefaultUnix<Tz, OFFSET_HOURS>>
fn with_month(&self, month: u32) -> Option<DateTimeDefaultUnix<Tz, OFFSET_HOURS>>
sourcefn with_month0(
&self,
month0: u32
) -> Option<DateTimeDefaultUnix<Tz, OFFSET_HOURS>>
fn with_month0(
&self,
month0: u32
) -> Option<DateTimeDefaultUnix<Tz, OFFSET_HOURS>>
sourcefn with_day(&self, day: u32) -> Option<DateTimeDefaultUnix<Tz, OFFSET_HOURS>>
fn with_day(&self, day: u32) -> Option<DateTimeDefaultUnix<Tz, OFFSET_HOURS>>
sourcefn with_day0(&self, day0: u32) -> Option<DateTimeDefaultUnix<Tz, OFFSET_HOURS>>
fn with_day0(&self, day0: u32) -> Option<DateTimeDefaultUnix<Tz, OFFSET_HOURS>>
sourcefn with_ordinal(
&self,
ordinal: u32
) -> Option<DateTimeDefaultUnix<Tz, OFFSET_HOURS>>
fn with_ordinal(
&self,
ordinal: u32
) -> Option<DateTimeDefaultUnix<Tz, OFFSET_HOURS>>
sourcefn with_ordinal0(
&self,
ordinal0: u32
) -> Option<DateTimeDefaultUnix<Tz, OFFSET_HOURS>>
fn with_ordinal0(
&self,
ordinal0: u32
) -> Option<DateTimeDefaultUnix<Tz, OFFSET_HOURS>>
sourcefn year_ce(&self) -> (bool, u32)
fn year_ce(&self) -> (bool, u32)
sourcefn num_days_from_ce(&self) -> i32
fn num_days_from_ce(&self) -> i32
sourceimpl<Tz: Debug, const OFFSET_HOURS: i32> Debug for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz: Debug, const OFFSET_HOURS: i32> Debug for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
sourceimpl<const OFFSET_HOURS: i32> Default for DateTimeDefaultUnix<FixedOffset, OFFSET_HOURS>
impl<const OFFSET_HOURS: i32> Default for DateTimeDefaultUnix<FixedOffset, OFFSET_HOURS>
sourceimpl Default for DateTimeDefaultUnix<Local, 0>
impl Default for DateTimeDefaultUnix<Local, 0>
sourceimpl Default for DateTimeDefaultUnix<Utc, 0>
impl Default for DateTimeDefaultUnix<Utc, 0>
sourceimpl<Tz, const OFFSET_HOURS: i32> Deref for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz, const OFFSET_HOURS: i32> Deref for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
sourceimpl<Tz, const OFFSET_HOURS: i32> Display for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy + Display,
impl<Tz, const OFFSET_HOURS: i32> Display for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy + Display,
sourceimpl<Tz, const OFFSET_HOURS: i32> DurationRound for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz, const OFFSET_HOURS: i32> DurationRound for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
type Err = RoundingError
type Err = RoundingError
sourceimpl<Tz, const OFFSET_HOURS: i32> From<DateTime<Tz>> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz, const OFFSET_HOURS: i32> From<DateTime<Tz>> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
sourceimpl<const OFFSET_HOURS: i32> FromStr for DateTimeDefaultUnix<FixedOffset, OFFSET_HOURS>
impl<const OFFSET_HOURS: i32> FromStr for DateTimeDefaultUnix<FixedOffset, OFFSET_HOURS>
type Err = ParseError
type Err = ParseError
sourcefn from_str(
s: &str
) -> ParseResult<DateTimeDefaultUnix<FixedOffset, OFFSET_HOURS>>
fn from_str(
s: &str
) -> ParseResult<DateTimeDefaultUnix<FixedOffset, OFFSET_HOURS>>
s
to return a value of this type. Read moresourceimpl<const OFFSET_HOURS: i32> FromStr for DateTimeDefaultUnix<Local, OFFSET_HOURS>
impl<const OFFSET_HOURS: i32> FromStr for DateTimeDefaultUnix<Local, OFFSET_HOURS>
type Err = ParseError
type Err = ParseError
sourcefn from_str(s: &str) -> ParseResult<DateTimeDefaultUnix<Local, OFFSET_HOURS>>
fn from_str(s: &str) -> ParseResult<DateTimeDefaultUnix<Local, OFFSET_HOURS>>
s
to return a value of this type. Read moresourceimpl<const OFFSET_HOURS: i32> FromStr for DateTimeDefaultUnix<Utc, OFFSET_HOURS>
impl<const OFFSET_HOURS: i32> FromStr for DateTimeDefaultUnix<Utc, OFFSET_HOURS>
type Err = ParseError
type Err = ParseError
sourcefn from_str(s: &str) -> ParseResult<DateTimeDefaultUnix<Utc, OFFSET_HOURS>>
fn from_str(s: &str) -> ParseResult<DateTimeDefaultUnix<Utc, OFFSET_HOURS>>
s
to return a value of this type. Read moresourceimpl<Tz: Hash, const OFFSET_HOURS: i32> Hash for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz: Hash, const OFFSET_HOURS: i32> Hash for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
sourceimpl<Tz: Ord, const OFFSET_HOURS: i32> Ord for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz: Ord, const OFFSET_HOURS: i32> Ord for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
sourcefn cmp(&self, other: &DateTimeDefaultUnix<Tz, OFFSET_HOURS>) -> Ordering
fn cmp(&self, other: &DateTimeDefaultUnix<Tz, OFFSET_HOURS>) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
sourceimpl<Tz, const OFFSET_HOURS: i32> PartialEq<DateTime<Tz>> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz, const OFFSET_HOURS: i32> PartialEq<DateTime<Tz>> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
sourceimpl<Tz, const OFFSET_HOURS: i32> PartialEq<DateTimeDefaultUnix<Tz, OFFSET_HOURS>> for DateTime<Tz>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz, const OFFSET_HOURS: i32> PartialEq<DateTimeDefaultUnix<Tz, OFFSET_HOURS>> for DateTime<Tz>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
sourcefn eq(&self, other: &DateTimeDefaultUnix<Tz, OFFSET_HOURS>) -> bool
fn eq(&self, other: &DateTimeDefaultUnix<Tz, OFFSET_HOURS>) -> bool
sourceimpl<Tz: PartialEq, const OFFSET_HOURS: i32> PartialEq<DateTimeDefaultUnix<Tz, OFFSET_HOURS>> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz: PartialEq, const OFFSET_HOURS: i32> PartialEq<DateTimeDefaultUnix<Tz, OFFSET_HOURS>> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
sourcefn eq(&self, other: &DateTimeDefaultUnix<Tz, OFFSET_HOURS>) -> bool
fn eq(&self, other: &DateTimeDefaultUnix<Tz, OFFSET_HOURS>) -> bool
sourceimpl<Tz, const OFFSET_HOURS: i32> PartialOrd<DateTime<Tz>> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz, const OFFSET_HOURS: i32> PartialOrd<DateTime<Tz>> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
sourcefn partial_cmp(&self, other: &DateTime<Tz>) -> Option<Ordering>
fn partial_cmp(&self, other: &DateTime<Tz>) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresourceimpl<Tz, const OFFSET_HOURS: i32> PartialOrd<DateTimeDefaultUnix<Tz, OFFSET_HOURS>> for DateTime<Tz>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz, const OFFSET_HOURS: i32> PartialOrd<DateTimeDefaultUnix<Tz, OFFSET_HOURS>> for DateTime<Tz>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
sourcefn partial_cmp(
&self,
other: &DateTimeDefaultUnix<Tz, OFFSET_HOURS>
) -> Option<Ordering>
fn partial_cmp(
&self,
other: &DateTimeDefaultUnix<Tz, OFFSET_HOURS>
) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresourceimpl<Tz: PartialOrd, const OFFSET_HOURS: i32> PartialOrd<DateTimeDefaultUnix<Tz, OFFSET_HOURS>> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz: PartialOrd, const OFFSET_HOURS: i32> PartialOrd<DateTimeDefaultUnix<Tz, OFFSET_HOURS>> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
sourcefn partial_cmp(
&self,
other: &DateTimeDefaultUnix<Tz, OFFSET_HOURS>
) -> Option<Ordering>
fn partial_cmp(
&self,
other: &DateTimeDefaultUnix<Tz, OFFSET_HOURS>
) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresourceimpl<Tz, const OFFSET_HOURS: i32> Sub<DateTime<Tz>> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz, const OFFSET_HOURS: i32> Sub<DateTime<Tz>> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
sourceimpl<Tz, const OFFSET_HOURS: i32> Sub<DateTimeDefaultUnix<Tz, OFFSET_HOURS>> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz, const OFFSET_HOURS: i32> Sub<DateTimeDefaultUnix<Tz, OFFSET_HOURS>> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
sourceimpl<Tz, const OFFSET_HOURS: i32> Sub<Duration> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz, const OFFSET_HOURS: i32> Sub<Duration> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
sourceimpl<Tz, const OFFSET_HOURS: i32> Sub<FixedOffset> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz, const OFFSET_HOURS: i32> Sub<FixedOffset> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
type Output = DateTimeDefaultUnix<Tz, OFFSET_HOURS>
type Output = DateTimeDefaultUnix<Tz, OFFSET_HOURS>
-
operator.sourcefn sub(self, rhs: FixedOffset) -> Self::Output
fn sub(self, rhs: FixedOffset) -> Self::Output
-
operation. Read moresourceimpl<Tz, const OFFSET_HOURS: i32> SubAssign<Duration> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
impl<Tz, const OFFSET_HOURS: i32> SubAssign<Duration> for DateTimeDefaultUnix<Tz, OFFSET_HOURS>where
Tz: TimeZone,
<Tz as TimeZone>::Offset: Copy,
sourcefn sub_assign(&mut self, rhs: Duration)
fn sub_assign(&mut self, rhs: Duration)
-=
operation. Read more