Struct bson::UtcDateTime [] [src]

pub struct UtcDateTime(pub DateTime<UTC>);

DateTime representation in struct for serde serialization

Just a helper for convenience

#[macro_use]
extern crate serde_derive;
extern crate bson;
use bson::UtcDateTime;

#[derive(Serialize, Deserialize)]
struct Foo {
    date_time: UtcDateTime,
}

Methods from Deref<Target = DateTime<UTC>>

Retrieves a date component.

Retrieves a time component. Unlike date, this is not associated to the time zone.

Returns the number of non-leap seconds since January 1, 1970 0:00:00 UTC (aka "UNIX timestamp").

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

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

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

Retrieves an associated offset from UTC.

Retrieves an associated time zone.

Changes the associated time zone. This does not change the actual DateTime (but will change the string representation).

Adds given Duration to the current date and time.

Returns None when it will result in overflow.

Subtracts given Duration from the current date and time.

Returns None when it will result in overflow.

Subtracts another DateTime from the current date and time. This does not overflow or underflow at all.

Returns a view to the naive UTC datetime.

Returns a view to the naive local datetime.

Returns an RFC 2822 date and time string such as Tue, 1 Jul 2003 10:52:37 +0200.

Returns an RFC 3339 and ISO 8601 date and time string such as 1996-12-19T16:39:57-08:00.

Formats the combined date and time with the specified formatting items.

Formats the combined date and time with the specified format string. See the format::strftime module on the supported escape sequences.

Trait Implementations

impl Debug for UtcDateTime
[src]

Formats the value using the given formatter.

impl Eq for UtcDateTime
[src]

impl PartialEq for UtcDateTime
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Copy for UtcDateTime
[src]

impl Clone for UtcDateTime
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Deref for UtcDateTime
[src]

The resulting type after dereferencing

The method called to dereference a value

impl DerefMut for UtcDateTime
[src]

The method called to mutably dereference a value

impl Into<DateTime<UTC>> for UtcDateTime
[src]

Performs the conversion.

impl From<DateTime<UTC>> for UtcDateTime
[src]

Performs the conversion.

impl Serialize for UtcDateTime
[src]

Serialize this value into the given Serde serializer. Read more

impl<'de> Deserialize<'de> for UtcDateTime
[src]

Deserialize this value from the given Serde deserializer. Read more