pub struct Date { /* private fields */ }
Expand description

A date, represented as a text string.

A field is only respected if all superior fields are supplied. For example, to set the minute, the hour, day, etc. have to be set. Similarly, in order for the time zone information to be written, all time information (including seconds) must be written. utc_offset_minute is optional if supplying time zone info. It must only be used to specify sub-hour time zone offsets.

Implementations

Create a new, minimal date. The year will be clamped within the range 0-9999.

Add the month field. It will be clamped within the range 1-12.

Add the day field. It will be clamped within the range 1-31.

Add the hour field. It will be clamped within the range 0-23.

Add the minute field. It will be clamped within the range 0-59.

Add the second field. It will be clamped within the range 0-59.

Add the offset from UTC in hours. If not specified, the time will be assumed to be local to the viewer’s time zone. It will be clamped within the range -23-23.

Add the offset from UTC in minutes. This will have the same sign as set in Self::utc_offset_hour. It will be clamped within the range 0-59.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

This method tests for !=.

Write the object into a buffer.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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)

Uses borrowed data to replace owned data, usually by cloning. 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.