[][src]Struct chrono::date::Date

pub struct Date<Tz: TimeZone> { /* fields omitted */ }

ISO 8601 calendar date with time zone.

This type should be considered ambiguous at best, due to the inherent lack of precision required for the time zone resolution. There are some guarantees on the usage of Date<Tz>:

Methods

impl<Tz: TimeZone> Date<Tz>
[src]

Makes a new Date with given UTC date and offset. The local date should be constructed via the TimeZone trait.

Makes a new DateTime from the current date and given NaiveTime. The offset in the current date is preserved.

Panics on invalid datetime.

Makes a new DateTime from the current date, hour, minute and second. The offset in the current date is preserved.

Panics on invalid hour, minute and/or second.

Makes a new DateTime from the current date, hour, minute and second. The offset in the current date is preserved.

Returns None on invalid hour, minute and/or second.

Makes a new DateTime from the current date, hour, minute, second and millisecond. The millisecond part can exceed 1,000 in order to represent the leap second. The offset in the current date is preserved.

Panics on invalid hour, minute, second and/or millisecond.

Makes a new DateTime from the current date, hour, minute, second and millisecond. The millisecond part can exceed 1,000 in order to represent the leap second. The offset in the current date is preserved.

Returns None on invalid hour, minute, second and/or millisecond.

Makes a new DateTime from the current date, hour, minute, second and microsecond. The microsecond part can exceed 1,000,000 in order to represent the leap second. The offset in the current date is preserved.

Panics on invalid hour, minute, second and/or microsecond.

Makes a new DateTime from the current date, hour, minute, second and microsecond. The microsecond part can exceed 1,000,000 in order to represent the leap second. The offset in the current date is preserved.

Returns None on invalid hour, minute, second and/or microsecond.

Makes a new DateTime from the current date, hour, minute, second and nanosecond. The nanosecond part can exceed 1,000,000,000 in order to represent the leap second. The offset in the current date is preserved.

Panics on invalid hour, minute, second and/or nanosecond.

Makes a new DateTime from the current date, hour, minute, second and nanosecond. The nanosecond part can exceed 1,000,000,000 in order to represent the leap second. The offset in the current date is preserved.

Returns None on invalid hour, minute, second and/or nanosecond.

Makes a new Date for the next date.

Panics when self is the last representable date.

Makes a new Date for the next date.

Returns None when self is the last representable date.

Makes a new Date for the prior date.

Panics when self is the first representable date.

Makes a new Date for the prior date.

Returns None when self is the first representable date.

Retrieves an associated offset from UTC.

Retrieves an associated time zone.

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

Adds given Duration to the current date.

Returns None when it will result in overflow.

Subtracts given Duration from the current date.

Returns None when it will result in overflow.

Returns a view to the naive UTC date.

Returns a view to the naive local date.

impl<Tz: TimeZone> Date<Tz> where
    Tz::Offset: Display
[src]

Formats the date with the specified formatting items.

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

Trait Implementations

impl<Tz: TimeZone> Datelike for Date<Tz>
[src]

Returns the year number in the calendar date.

Returns the month number starting from 1. Read more

Returns the month number starting from 0. Read more

Returns the day of month starting from 1. Read more

Returns the day of month starting from 0. Read more

Returns the day of year starting from 1. Read more

Returns the day of year starting from 0. Read more

Returns the day of week.

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

Makes a new value with the year number changed. Read more

Makes a new value with the month number (starting from 1) changed. Read more

Makes a new value with the month number (starting from 0) changed. Read more

Makes a new value with the day of month (starting from 1) changed. Read more

Makes a new value with the day of month (starting from 0) changed. Read more

Makes a new value with the day of year (starting from 1) changed. Read more

Makes a new value with the day of year (starting from 0) changed. Read more

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

Returns the number of days since January 1, 1 (Day 1) in the proleptic Gregorian calendar.

impl<Tz: Clone + TimeZone> Clone for Date<Tz> where
    Tz::Offset: Clone
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<Tz: TimeZone> Copy for Date<Tz> where
    <Tz as TimeZone>::Offset: Copy
[src]

impl<Tz: TimeZone> Eq for Date<Tz>
[src]

impl<Tz: TimeZone> PartialOrd<Date<Tz>> for Date<Tz>
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<Tz: TimeZone, Tz2: TimeZone> PartialEq<Date<Tz2>> for Date<Tz>
[src]

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

This method tests for !=.

impl<Tz: TimeZone> Send for Date<Tz> where
    <Tz as TimeZone>::Offset: Send
[src]

impl<Tz: TimeZone> Ord for Date<Tz>
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl<Tz: TimeZone> Hash for Date<Tz>
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<Tz: TimeZone> Display for Date<Tz> where
    Tz::Offset: Display
[src]

Formats the value using the given formatter. Read more

impl<Tz: TimeZone> Debug for Date<Tz>
[src]

Formats the value using the given formatter. Read more

impl<Tz: TimeZone> Add<Duration> for Date<Tz>
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl<Tz: TimeZone, Tz2: TimeZone> Sub<Date<Tz2>> for Date<Tz>
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl<Tz: TimeZone> Sub<Duration> for Date<Tz>
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl<Tz: TimeZone> Encodable for Date<Tz> where
    Tz::Offset: Encodable
[src]

Serialize a value using an Encoder.

impl<Tz: TimeZone> Decodable for Date<Tz> where
    Tz::Offset: Decodable
[src]

Deserialize a value using a Decoder.

Auto Trait Implementations

impl<Tz> Sync for Date<Tz> where
    <Tz as TimeZone>::Offset: Sync

Blanket Implementations

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

Converts the given value to a String. Read more

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 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]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 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