[−][src]Struct chrono::naive::datetime::NaiveDateTime
ISO 8601 combined date and time without timezone.
Methods
impl NaiveDateTime[src]
impl NaiveDateTimepub fn new(date: NaiveDate, time: NaiveTime) -> NaiveDateTime[src]
pub fn new(date: NaiveDate, time: NaiveTime) -> NaiveDateTimeMakes a new NaiveDateTime from date and time components.
Equivalent to date.and_time(time) and many other helper constructors on NaiveDate.
pub fn from_timestamp(secs: i64, nsecs: u32) -> NaiveDateTime[src]
pub fn from_timestamp(secs: i64, nsecs: u32) -> NaiveDateTimeMakes a new NaiveDateTime from the number of non-leap seconds
since the midnight UTC on January 1, 1970 (aka "UNIX timestamp")
and the number of nanoseconds since the last whole non-leap second.
Panics on the out-of-range number of seconds and/or invalid nanosecond.
pub fn from_timestamp_opt(secs: i64, nsecs: u32) -> Option<NaiveDateTime>[src]
pub fn from_timestamp_opt(secs: i64, nsecs: u32) -> Option<NaiveDateTime>Makes a new NaiveDateTime from the number of non-leap seconds
since the midnight UTC on January 1, 1970 (aka "UNIX timestamp")
and the number of nanoseconds since the last whole non-leap second.
Returns None on the out-of-range number of seconds and/or invalid nanosecond.
pub fn from_num_seconds_from_unix_epoch(secs: i64, nsecs: u32) -> NaiveDateTime[src]
pub fn from_num_seconds_from_unix_epoch(secs: i64, nsecs: u32) -> NaiveDateTimeDeprecated: Same to NaiveDateTime::from_timestamp.
pub fn from_num_seconds_from_unix_epoch_opt(
secs: i64,
nsecs: u32
) -> Option<NaiveDateTime>[src]
pub fn from_num_seconds_from_unix_epoch_opt(
secs: i64,
nsecs: u32
) -> Option<NaiveDateTime>Deprecated: Same to NaiveDateTime::from_timestamp_opt.
pub fn parse_from_str(s: &str, fmt: &str) -> ParseResult<NaiveDateTime>[src]
pub fn parse_from_str(s: &str, fmt: &str) -> ParseResult<NaiveDateTime>Parses a string with the specified format string and returns a new NaiveDateTime.
See the format::strftime module
on the supported escape sequences.
pub fn date(&self) -> NaiveDate[src]
pub fn date(&self) -> NaiveDateRetrieves a date component.
pub fn time(&self) -> NaiveTime[src]
pub fn time(&self) -> NaiveTimeRetrieves a time component.
pub fn timestamp(&self) -> i64[src]
pub fn timestamp(&self) -> i64Returns the number of non-leap seconds since the midnight on January 1, 1970.
Note that this does not account for the timezone! The true "UNIX timestamp" would count seconds since the midnight UTC on the epoch.
pub fn timestamp_subsec_millis(&self) -> u32[src]
pub fn timestamp_subsec_millis(&self) -> u32Returns the number of milliseconds since the last whole non-leap second.
The return value ranges from 0 to 999, or for leap seconds, to 1,999.
pub fn timestamp_subsec_micros(&self) -> u32[src]
pub fn timestamp_subsec_micros(&self) -> u32Returns the number of microseconds since the last whole non-leap second.
The return value ranges from 0 to 999,999, or for leap seconds, to 1,999,999.
pub fn timestamp_subsec_nanos(&self) -> u32[src]
pub fn timestamp_subsec_nanos(&self) -> u32Returns the number of nanoseconds since the last whole non-leap second.
The return value ranges from 0 to 999,999,999, or for leap seconds, to 1,999,999,999.
pub fn num_seconds_from_unix_epoch(&self) -> i64[src]
pub fn num_seconds_from_unix_epoch(&self) -> i64Deprecated: Same to NaiveDateTime::timestamp.
pub fn checked_add(self, rhs: Duration) -> Option<NaiveDateTime>[src]
pub fn checked_add(self, rhs: Duration) -> Option<NaiveDateTime>Adds given Duration to the current date and time.
Returns None when it will result in overflow.
pub fn checked_sub(self, rhs: Duration) -> Option<NaiveDateTime>[src]
pub fn checked_sub(self, rhs: Duration) -> Option<NaiveDateTime>Subtracts given Duration from the current date and time.
Returns None when it will result in overflow.
pub fn format_with_items<'a, I>(&self, items: I) -> DelayedFormat<I> where
I: Iterator<Item = Item<'a>> + Clone, [src]
pub fn format_with_items<'a, I>(&self, items: I) -> DelayedFormat<I> where
I: Iterator<Item = Item<'a>> + Clone, Formats the combined date and time with the specified formatting items.
pub fn format<'a>(&self, fmt: &'a str) -> DelayedFormat<StrftimeItems<'a>>[src]
pub fn format<'a>(&self, fmt: &'a str) -> DelayedFormat<StrftimeItems<'a>>Formats the combined date and time with the specified format string.
See the format::strftime module
on the supported escape sequences.
Trait Implementations
impl Datelike for NaiveDateTime[src]
impl Datelike for NaiveDateTimefn year(&self) -> i32[src]
fn year(&self) -> i32Returns the year number in the calendar date.
See also the NaiveDate::year method.
Example
use chrono::{NaiveDate, NaiveDateTime, Datelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 25).and_hms(12, 34, 56); assert_eq!(dt.year(), 2015);
fn month(&self) -> u32[src]
fn month(&self) -> u32Returns the month number starting from 1.
The return value ranges from 1 to 12.
See also the NaiveDate::month method.
Example
use chrono::{NaiveDate, NaiveDateTime, Datelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 25).and_hms(12, 34, 56); assert_eq!(dt.month(), 9);
fn month0(&self) -> u32[src]
fn month0(&self) -> u32Returns the month number starting from 0.
The return value ranges from 0 to 11.
See also the NaiveDate::month0 method.
Example
use chrono::{NaiveDate, NaiveDateTime, Datelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 25).and_hms(12, 34, 56); assert_eq!(dt.month0(), 8);
fn day(&self) -> u32[src]
fn day(&self) -> u32Returns the day of month starting from 1.
The return value ranges from 1 to 31. (The last day of month differs by months.)
See also the NaiveDate::day method.
Example
use chrono::{NaiveDate, NaiveDateTime, Datelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 25).and_hms(12, 34, 56); assert_eq!(dt.day(), 25);
fn day0(&self) -> u32[src]
fn day0(&self) -> u32Returns the day of month starting from 0.
The return value ranges from 0 to 30. (The last day of month differs by months.)
See also the NaiveDate::day0 method.
Example
use chrono::{NaiveDate, NaiveDateTime, Datelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 25).and_hms(12, 34, 56); assert_eq!(dt.day0(), 24);
fn ordinal(&self) -> u32[src]
fn ordinal(&self) -> u32Returns the day of year starting from 1.
The return value ranges from 1 to 366. (The last day of year differs by years.)
See also the NaiveDate::ordinal method.
Example
use chrono::{NaiveDate, NaiveDateTime, Datelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 25).and_hms(12, 34, 56); assert_eq!(dt.ordinal(), 268);
fn ordinal0(&self) -> u32[src]
fn ordinal0(&self) -> u32Returns the day of year starting from 0.
The return value ranges from 0 to 365. (The last day of year differs by years.)
See also the NaiveDate::ordinal0 method.
Example
use chrono::{NaiveDate, NaiveDateTime, Datelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 25).and_hms(12, 34, 56); assert_eq!(dt.ordinal0(), 267);
fn weekday(&self) -> Weekday[src]
fn weekday(&self) -> WeekdayReturns the day of week.
See also the NaiveDate::weekday method.
Example
use chrono::{NaiveDate, NaiveDateTime, Datelike, Weekday}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 25).and_hms(12, 34, 56); assert_eq!(dt.weekday(), Weekday::Fri);
fn isoweekdate(&self) -> (i32, u32, Weekday)[src]
fn isoweekdate(&self) -> (i32, u32, Weekday)Returns the ISO week date: an adjusted year, week number and day of week. The adjusted year may differ from that of the calendar date. Read more
fn with_year(&self, year: i32) -> Option<NaiveDateTime>[src]
fn with_year(&self, year: i32) -> Option<NaiveDateTime>Makes a new NaiveDateTime with the year number changed.
Returns None when the resulting NaiveDateTime would be invalid.
See also the
NaiveDate::with_year method.
Example
use chrono::{NaiveDate, NaiveDateTime, Datelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 25).and_hms(12, 34, 56); assert_eq!(dt.with_year(2016), Some(NaiveDate::from_ymd(2016, 9, 25).and_hms(12, 34, 56))); assert_eq!(dt.with_year(-308), Some(NaiveDate::from_ymd(-308, 9, 25).and_hms(12, 34, 56)));
fn with_month(&self, month: u32) -> Option<NaiveDateTime>[src]
fn with_month(&self, month: u32) -> Option<NaiveDateTime>Makes a new NaiveDateTime with the month number (starting from 1) changed.
Returns None when the resulting NaiveDateTime would be invalid.
See also the
NaiveDate::with_month method.
Example
use chrono::{NaiveDate, NaiveDateTime, Datelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 30).and_hms(12, 34, 56); assert_eq!(dt.with_month(10), Some(NaiveDate::from_ymd(2015, 10, 30).and_hms(12, 34, 56))); assert_eq!(dt.with_month(13), None); // no month 13 assert_eq!(dt.with_month(2), None); // no February 30
fn with_month0(&self, month0: u32) -> Option<NaiveDateTime>[src]
fn with_month0(&self, month0: u32) -> Option<NaiveDateTime>Makes a new NaiveDateTime with the month number (starting from 0) changed.
Returns None when the resulting NaiveDateTime would be invalid.
See also the
NaiveDate::with_month0 method.
Example
use chrono::{NaiveDate, NaiveDateTime, Datelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 30).and_hms(12, 34, 56); assert_eq!(dt.with_month0(9), Some(NaiveDate::from_ymd(2015, 10, 30).and_hms(12, 34, 56))); assert_eq!(dt.with_month0(12), None); // no month 13 assert_eq!(dt.with_month0(1), None); // no February 30
fn with_day(&self, day: u32) -> Option<NaiveDateTime>[src]
fn with_day(&self, day: u32) -> Option<NaiveDateTime>Makes a new NaiveDateTime with the day of month (starting from 1) changed.
Returns None when the resulting NaiveDateTime would be invalid.
See also the
NaiveDate::with_day method.
Example
use chrono::{NaiveDate, NaiveDateTime, Datelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 8).and_hms(12, 34, 56); assert_eq!(dt.with_day(30), Some(NaiveDate::from_ymd(2015, 9, 30).and_hms(12, 34, 56))); assert_eq!(dt.with_day(31), None); // no September 31
fn with_day0(&self, day0: u32) -> Option<NaiveDateTime>[src]
fn with_day0(&self, day0: u32) -> Option<NaiveDateTime>Makes a new NaiveDateTime with the day of month (starting from 0) changed.
Returns None when the resulting NaiveDateTime would be invalid.
See also the
NaiveDate::with_day0 method.
Example
use chrono::{NaiveDate, NaiveDateTime, Datelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 8).and_hms(12, 34, 56); assert_eq!(dt.with_day0(29), Some(NaiveDate::from_ymd(2015, 9, 30).and_hms(12, 34, 56))); assert_eq!(dt.with_day0(30), None); // no September 31
fn with_ordinal(&self, ordinal: u32) -> Option<NaiveDateTime>[src]
fn with_ordinal(&self, ordinal: u32) -> Option<NaiveDateTime>Makes a new NaiveDateTime with the day of year (starting from 1) changed.
Returns None when the resulting NaiveDateTime would be invalid.
See also the
NaiveDate::with_ordinal method.
Example
use chrono::{NaiveDate, NaiveDateTime, Datelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 8).and_hms(12, 34, 56); assert_eq!(dt.with_ordinal(60), Some(NaiveDate::from_ymd(2015, 3, 1).and_hms(12, 34, 56))); assert_eq!(dt.with_ordinal(366), None); // 2015 had only 365 days let dt: NaiveDateTime = NaiveDate::from_ymd(2016, 9, 8).and_hms(12, 34, 56); assert_eq!(dt.with_ordinal(60), Some(NaiveDate::from_ymd(2016, 2, 29).and_hms(12, 34, 56))); assert_eq!(dt.with_ordinal(366), Some(NaiveDate::from_ymd(2016, 12, 31).and_hms(12, 34, 56)));
fn with_ordinal0(&self, ordinal0: u32) -> Option<NaiveDateTime>[src]
fn with_ordinal0(&self, ordinal0: u32) -> Option<NaiveDateTime>Makes a new NaiveDateTime with the day of year (starting from 0) changed.
Returns None when the resulting NaiveDateTime would be invalid.
See also the
NaiveDate::with_ordinal0 method.
Example
use chrono::{NaiveDate, NaiveDateTime, Datelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 8).and_hms(12, 34, 56); assert_eq!(dt.with_ordinal0(59), Some(NaiveDate::from_ymd(2015, 3, 1).and_hms(12, 34, 56))); assert_eq!(dt.with_ordinal0(365), None); // 2015 had only 365 days let dt: NaiveDateTime = NaiveDate::from_ymd(2016, 9, 8).and_hms(12, 34, 56); assert_eq!(dt.with_ordinal0(59), Some(NaiveDate::from_ymd(2016, 2, 29).and_hms(12, 34, 56))); assert_eq!(dt.with_ordinal0(365), Some(NaiveDate::from_ymd(2016, 12, 31).and_hms(12, 34, 56)));
fn year_ce(&self) -> (bool, u32)[src]
fn year_ce(&self) -> (bool, u32)Returns the absolute year number starting from 1 with a boolean flag, which is false when the year predates the epoch (BCE/BC) and true otherwise (CE/AD). Read more
fn num_days_from_ce(&self) -> i32[src]
fn num_days_from_ce(&self) -> i32Returns the number of days since January 1, 1 (Day 1) in the proleptic Gregorian calendar.
impl Timelike for NaiveDateTime[src]
impl Timelike for NaiveDateTimefn hour(&self) -> u32[src]
fn hour(&self) -> u32Returns the hour number from 0 to 23.
See also the NaiveTime::hour method.
Example
use chrono::{NaiveDate, NaiveDateTime, Timelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(12, 34, 56, 789); assert_eq!(dt.hour(), 12);
fn minute(&self) -> u32[src]
fn minute(&self) -> u32Returns the minute number from 0 to 59.
See also the NaiveTime::minute method.
Example
use chrono::{NaiveDate, NaiveDateTime, Timelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(12, 34, 56, 789); assert_eq!(dt.minute(), 34);
fn second(&self) -> u32[src]
fn second(&self) -> u32Returns the second number from 0 to 59.
See also the NaiveTime::second method.
Example
use chrono::{NaiveDate, NaiveDateTime, Timelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(12, 34, 56, 789); assert_eq!(dt.second(), 56);
fn nanosecond(&self) -> u32[src]
fn nanosecond(&self) -> u32Returns the number of nanoseconds since the whole non-leap second. The range from 1,000,000,000 to 1,999,999,999 represents the leap second.
See also the
NaiveTime::nanosecond method.
Example
use chrono::{NaiveDate, NaiveDateTime, Timelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(12, 34, 56, 789); assert_eq!(dt.nanosecond(), 789_000_000);
fn with_hour(&self, hour: u32) -> Option<NaiveDateTime>[src]
fn with_hour(&self, hour: u32) -> Option<NaiveDateTime>Makes a new NaiveDateTime with the hour number changed.
Returns None when the resulting NaiveDateTime would be invalid.
See also the
NaiveTime::with_hour method.
Example
use chrono::{NaiveDate, NaiveDateTime, Timelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(12, 34, 56, 789); assert_eq!(dt.with_hour(7), Some(NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(7, 34, 56, 789))); assert_eq!(dt.with_hour(24), None);
fn with_minute(&self, min: u32) -> Option<NaiveDateTime>[src]
fn with_minute(&self, min: u32) -> Option<NaiveDateTime>Makes a new NaiveDateTime with the minute number changed.
Returns None when the resulting NaiveDateTime would be invalid.
See also the
NaiveTime::with_minute method.
Example
use chrono::{NaiveDate, NaiveDateTime, Timelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(12, 34, 56, 789); assert_eq!(dt.with_minute(45), Some(NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(12, 45, 56, 789))); assert_eq!(dt.with_minute(60), None);
fn with_second(&self, sec: u32) -> Option<NaiveDateTime>[src]
fn with_second(&self, sec: u32) -> Option<NaiveDateTime>Makes a new NaiveDateTime with the second number changed.
Returns None when the resulting NaiveDateTime would be invalid.
As with the second method,
the input range is restricted to 0 through 59.
See also the
NaiveTime::with_second method.
Example
use chrono::{NaiveDate, NaiveDateTime, Timelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(12, 34, 56, 789); assert_eq!(dt.with_second(17), Some(NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(12, 34, 17, 789))); assert_eq!(dt.with_second(60), None);
fn with_nanosecond(&self, nano: u32) -> Option<NaiveDateTime>[src]
fn with_nanosecond(&self, nano: u32) -> Option<NaiveDateTime>Makes a new NaiveDateTime with nanoseconds since the whole non-leap second changed.
Returns None when the resulting NaiveDateTime would be invalid.
As with the nanosecond method,
the input range can exceed 1,000,000,000 for leap seconds.
See also the
NaiveTime::with_nanosecond
method.
Example
use chrono::{NaiveDate, NaiveDateTime, Timelike}; let dt: NaiveDateTime = NaiveDate::from_ymd(2015, 9, 8).and_hms_milli(12, 34, 56, 789); assert_eq!(dt.with_nanosecond(333_333_333), Some(NaiveDate::from_ymd(2015, 9, 8).and_hms_nano(12, 34, 56, 333_333_333))); assert_eq!(dt.with_nanosecond(1_333_333_333), // leap second Some(NaiveDate::from_ymd(2015, 9, 8).and_hms_nano(12, 34, 56, 1_333_333_333))); assert_eq!(dt.with_nanosecond(2_000_000_000), None);
fn hour12(&self) -> (bool, u32)[src]
fn hour12(&self) -> (bool, u32)Returns the hour number from 1 to 12 with a boolean flag, which is false for AM and true for PM. Read more
fn num_seconds_from_midnight(&self) -> u32[src]
fn num_seconds_from_midnight(&self) -> u32Returns the number of non-leap seconds past the last midnight.
impl Clone for NaiveDateTime[src]
impl Clone for NaiveDateTimefn clone(&self) -> NaiveDateTime[src]
fn clone(&self) -> NaiveDateTimeReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Copy for NaiveDateTime[src]
impl Copy for NaiveDateTimeimpl Eq for NaiveDateTime[src]
impl Eq for NaiveDateTimeimpl PartialOrd<NaiveDateTime> for NaiveDateTime[src]
impl PartialOrd<NaiveDateTime> for NaiveDateTimefn partial_cmp(&self, other: &NaiveDateTime) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &NaiveDateTime) -> Option<Ordering>This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, other: &NaiveDateTime) -> bool[src]
fn lt(&self, other: &NaiveDateTime) -> boolThis method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, other: &NaiveDateTime) -> bool[src]
fn le(&self, other: &NaiveDateTime) -> boolThis method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, other: &NaiveDateTime) -> bool[src]
fn gt(&self, other: &NaiveDateTime) -> boolThis method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, other: &NaiveDateTime) -> bool[src]
fn ge(&self, other: &NaiveDateTime) -> boolThis method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl PartialEq<NaiveDateTime> for NaiveDateTime[src]
impl PartialEq<NaiveDateTime> for NaiveDateTimefn eq(&self, other: &NaiveDateTime) -> bool[src]
fn eq(&self, other: &NaiveDateTime) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &NaiveDateTime) -> bool[src]
fn ne(&self, other: &NaiveDateTime) -> boolThis method tests for !=.
impl Ord for NaiveDateTime[src]
impl Ord for NaiveDateTimefn cmp(&self, other: &NaiveDateTime) -> Ordering[src]
fn cmp(&self, other: &NaiveDateTime) -> OrderingThis method returns an Ordering between self and other. Read more
fn max(self, other: Self) -> Self1.21.0[src]
fn max(self, other: Self) -> SelfCompares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
fn min(self, other: Self) -> SelfCompares and returns the minimum of two values. Read more
impl Hash for NaiveDateTime[src]
impl Hash for NaiveDateTimeNaiveDateTime can be used as a key to the hash maps (in principle).
Practically this also takes account of fractional seconds, so it is not recommended. (For the obvious reason this also distinguishes leap seconds from non-leap seconds.)
fn hash<H: Hasher>(&self, state: &mut H)[src]
fn hash<H: Hasher>(&self, state: &mut H)Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl Display for NaiveDateTime[src]
impl Display for NaiveDateTimefn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Debug for NaiveDateTime[src]
impl Debug for NaiveDateTimefn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl FromStr for NaiveDateTime[src]
impl FromStr for NaiveDateTimetype Err = ParseError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> ParseResult<NaiveDateTime>[src]
fn from_str(s: &str) -> ParseResult<NaiveDateTime>Parses a string s to return a value of this type. Read more
impl Add<Duration> for NaiveDateTime[src]
impl Add<Duration> for NaiveDateTimetype Output = NaiveDateTime
The resulting type after applying the + operator.
fn add(self, rhs: Duration) -> NaiveDateTime[src]
fn add(self, rhs: Duration) -> NaiveDateTimePerforms the + operation.
impl Sub<NaiveDateTime> for NaiveDateTime[src]
impl Sub<NaiveDateTime> for NaiveDateTimetype Output = Duration
The resulting type after applying the - operator.
fn sub(self, rhs: NaiveDateTime) -> Duration[src]
fn sub(self, rhs: NaiveDateTime) -> DurationPerforms the - operation.
impl Sub<Duration> for NaiveDateTime[src]
impl Sub<Duration> for NaiveDateTimetype Output = NaiveDateTime
The resulting type after applying the - operator.
fn sub(self, rhs: Duration) -> NaiveDateTime[src]
fn sub(self, rhs: Duration) -> NaiveDateTimePerforms the - operation.
impl Encodable for NaiveDateTime[src]
impl Encodable for NaiveDateTimefn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error>[src]
fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error>Serialize a value using an Encoder.
impl Decodable for NaiveDateTime[src]
impl Decodable for NaiveDateTimeAuto Trait Implementations
impl Send for NaiveDateTime
impl Send for NaiveDateTimeimpl Sync for NaiveDateTime
impl Sync for NaiveDateTimeBlanket Implementations
impl<T> From for T[src]
impl<T> From for Timpl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T> ToString for T where
T: Display + ?Sized, [src]
impl<T> ToString for T where
T: Display + ?Sized, impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, type Owned = T
fn to_owned(&self) -> T[src]
fn to_owned(&self) -> TCreates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)[src]
fn clone_into(&self, target: &mut T)🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>try_from)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut TMutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>try_from)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeId🔬 This is a nightly-only experimental API. (get_type_id)
this method will likely be replaced by an associated static
Gets the TypeId of self. Read more