Skip to main content

Module dates

Module dates 

Source
Expand description

Immutable Gregorian dates, stored as days since 1970-01-01. Public domain: 0001-01-01 through 9999-12-31. No clock is read here.

Constants§

MAX
MIN
WEEKDAYS

Functions§

add_days
add_months
add_workdays
Weekdays only, in constant time even for huge offsets. The starting date is not counted. A zero offset leaves even a weekend unchanged.
add_workdays_with_holidays
Holidays must be sorted, unique and weekdays. Each crossed holiday is visited once, extending the target by one weekday in the chosen direction.
add_years
end_of_month
format
from_civil
Days since 1970-01-01 for a year, month (1–12) and day (1–31).
from_parts
from_unix_seconds
parse
Exactly ten ASCII bytes. Validate before doing any calendar arithmetic.
start_of_month
to_civil
Year, month and day of a day number.
valid
weekday
0 = Monday … 6 = Sunday.