Struct task_hookrs::date::Date
[−]
[src]
pub struct Date(_);
Date is a NaiveDateTime-Wrapper object to be able to implement foreign traits on it
Methods from Deref<Target = NaiveDateTime>
fn date(&self) -> NaiveDate
Retrieves a date component.
fn time(&self) -> NaiveTime
Retrieves a time component.
fn timestamp(&self) -> i64
Returns 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.
fn timestamp_subsec_millis(&self) -> u32
Returns 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.
fn timestamp_subsec_micros(&self) -> u32
Returns 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.
fn timestamp_subsec_nanos(&self) -> u32
Returns 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.
fn num_seconds_from_unix_epoch(&self) -> i64
Deprecated: Same to NaiveDateTime::timestamp
.
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.
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.
fn format_with_items<'a, I>(&self, items: I) -> DelayedFormat<I> where
I: Iterator<Item = Item<'a>> + Clone,
I: Iterator<Item = Item<'a>> + Clone,
Formats the combined date and time with the specified formatting items.
fn format(&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 Clone for Date
[src]
fn clone(&self) -> Date
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Date
[src]
impl Hash for Date
[src]
fn hash<__H: Hasher>(&self, __arg_0: &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
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Eq for Date
[src]
impl PartialEq for Date
[src]
fn eq(&self, __arg_0: &Date) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Date) -> bool
This method tests for !=
.
impl Deref for Date
[src]
type Target = NaiveDateTime
The resulting type after dereferencing
fn deref(&self) -> &NaiveDateTime
The method called to dereference a value
impl DerefMut for Date
[src]
fn deref_mut(&mut self) -> &mut NaiveDateTime
The method called to mutably dereference a value
impl From<NaiveDateTime> for Date
[src]
fn from(ndt: NaiveDateTime) -> Date
Performs the conversion.
impl Serialize for Date
[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Deserialize for Date
[src]
fn deserialize<D>(deserializer: D) -> Result<Date, D::Error> where
D: Deserializer,
D: Deserializer,
Deserialize this value from the given Serde deserializer. Read more