Skip to main content

Module date

Module date 

Source
Expand description

Calendar dates in the proleptic Gregorian calendar, times of day, and the two together.

The arithmetic counts days since 1970-01-01 with Howard Hinnant’s civil-calendar algorithms, which are exact for every date an i32 year can hold.

Date and TimeOfDay carry no time zone. DateTime carries the offset from UTC of the moment it holds, and local_offset_minutes reads that offset from the system; where the system does not say, local_offset returns None instead of a made-up zero.

Structs§

Date
A calendar date.
DateTime
A date and a time of day together, with the offset from UTC the moment was read at.
TimeOfDay
A time of day on a 24-hour clock, with no date and no time zone.

Enums§

Weekday
A day of the week.

Functions§

days_in_month
How many days month of year has; 0 for a month outside 1 to 12.
is_leap_year
Whether year has a February 29.
local_offset
Minutes local time is ahead of UTC right now, or None when the system does not say.
local_offset_minutes
Minutes local time is ahead of UTC right now, and 0 when the system does not say.