Struct vimwiki::vendor::chrono::Date[][src]

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

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. For serialization and deserialization uses, it is best to use NaiveDate instead. There are some guarantees on the usage of Date<Tz>:

  • If properly constructed via TimeZone::ymd and others without an error, the corresponding local date should exist for at least a moment. (It may still have a gap from the offset changes.)

  • The TimeZone is free to assign any Offset to the local date, as long as that offset did occur in given day. For example, if 2015-03-08T01:59-08:00 is followed by 2015-03-08T03:00-07:00, it may produce either 2015-03-08-08:00 or 2015-03-08-07:00 but not 2015-03-08+00:00 and others.

  • Once constructed as a full DateTime, DateTime::date and other associated methods should return those for the original Date. For example, if dt = tz.ymd(y,m,d).hms(h,n,s) were valid, dt.date() == tz.ymd(y,m,d).

  • The date is timezone-agnostic up to one day (i.e. practically always), so the local date and UTC date should be equal for most cases even though the raw calculation between NaiveDate and Duration may not.

Implementations

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.

Subtracts another Date from the current date. Returns a Duration of integral numbers.

This does not overflow or underflow at all, as all possible output fits in the range of Duration.

Returns a view to the naive UTC date.

Returns a view to the naive local date.

This is technically the same as naive_utc because the offset is restricted to never exceed one day, but provided for the consistency.

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

The resulting type after applying the + operator.

Performs the + operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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.

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

Counts the days in the proleptic Gregorian calendar, with January 1, Year 1 (CE) as day 1. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

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

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

Restrict a value to a certain interval. Read more

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

This method tests for !=.

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

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into T using Into<T>. Read more

Converts self into a target type. Read more

Causes self to use its Binary implementation when Debug-formatted.

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted.

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Performs the conversion.

Performs the conversion.

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

Pipes a value into a function that cannot ordinarily be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a dereference into a function that cannot normally be called in suffix position. Read more

Pipes a mutable dereference into a function that cannot normally be called in suffix position. Read more

Pipes a reference into a function that cannot ordinarily be called in suffix position. Read more

Pipes a mutable reference into a function that cannot ordinarily be called in suffix position. Read more

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

Provides immutable access for inspection. Read more

Calls tap in debug builds, and does nothing in release builds.

Provides mutable access for modification. Read more

Calls tap_mut in debug builds, and does nothing in release builds.

Provides immutable access to the reference for inspection.

Calls tap_ref in debug builds, and does nothing in release builds.

Provides mutable access to the reference for modification.

Calls tap_ref_mut in debug builds, and does nothing in release builds.

Provides immutable access to the borrow for inspection. Read more

Calls tap_borrow in debug builds, and does nothing in release builds.

Provides mutable access to the borrow for modification.

Calls tap_borrow_mut in debug builds, and does nothing in release builds. Read more

Immutably dereferences self for inspection.

Calls tap_deref in debug builds, and does nothing in release builds.

Mutably dereferences self for modification.

Calls tap_deref_mut in debug builds, and does nothing in release builds. Read more

The resulting type after obtaining ownership.

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

Converts the given value to a String. Read more

Attempts to convert self into T using TryInto<T>. Read more

Attempts to convert self into a target type. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.