Struct bson::UtcDateTime [] [src]

pub struct UtcDateTime(pub DateTime<Utc>);

DateTime representation in struct for serde serialization

Just a helper for convenience

Be careful when using this code, it's not being tested!
#[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>>

[src]

Retrieves a date component.

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

Retrieves an associated offset from UTC.

[src]

Retrieves an associated time zone.

[src]

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

[src]

Adds given Duration to the current date and time.

Returns None when it will result in overflow.

[src]

Subtracts given Duration from the current date and time.

Returns None when it will result in overflow.

[src]

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

[src]

Returns a view to the naive UTC datetime.

[src]

Returns a view to the naive local datetime.

[src]

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

[src]

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

[src]

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

[src]

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]

[src]

Formats the value using the given formatter.

impl Eq for UtcDateTime
[src]

impl PartialEq for UtcDateTime
[src]

[src]

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

[src]

This method tests for !=.

impl Copy for UtcDateTime
[src]

impl Clone for UtcDateTime
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Deref for UtcDateTime
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.

impl DerefMut for UtcDateTime
[src]

[src]

Mutably dereferences the value.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

impl Serialize for UtcDateTime
[src]

[src]

Serialize this value into the given Serde serializer. Read more

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

[src]

Deserialize this value from the given Serde deserializer. Read more