Struct mini_functions::date::Date

source ·
#[non_exhaustive]
pub struct Date {}
Expand description

Date Utility

By default, the current date and time in UTC is returned.

Implementations§

Get the Date in the stored offset.

Get the day of the date in the stored offset.

The day is a number from 1 to 31.

Get the clock hour in the stored offset.

The hour is a number from 0 to 23. 0 is midnight. 12 is noon.

Get the ISO week number of the date in the stored offset.

The returned value will always be in the range 1..=53.

Get the microsecond of the second in the stored offset.

The returned value will always be in the range 0..1_000_000.

Get the milliseconds within the second in the stored offset.

The returned value will always be in the range 0..1_000.

Get the minute within the hour in the stored offset.

The returned value will always be in the range 0..60.

Get the month of the date in the stored offset.

The month is a number from 1 to 12. January is 1, February is 2, and so on.

Get the nanoseconds within the second in the stored offset.

The returned value will always be in the range 0..1_000_000_000.

Create a new OffsetDateTime in the ISO 8601 format.

Create a new OffsetDateTime with the current date and time (UTC)

Get the UtcOffset.

Get the day of the year of the date in the stored offset.

The returned value will always be in the range 1..=366.

Get the second within the minute in the stored offset.

The returned value will always be in the range 0..60.

Get the Time in the stored offset.

Get the Unix timestamp.

Get the weekday of the date in the stored offset.

This current uses Zellers congruence internally.

Get the year of the date in the stored offset.

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 ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
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

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 alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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.