Skip to main content

Module dates

Module dates 

Source
Expand description

Calendar days as integers: days since 1970-01-01, in UTC.

UTC rather than local time keeps the standard library sufficient. A due date therefore turns at UTC midnight, a few hours off local midnight.

Functionsยง

day
The day containing a Unix timestamp.
format
YYYY-MM-DD for a day number. Algorithm from https://howardhinnant.github.io/date_algorithms.html#civil_from_days
now
Seconds since the Unix epoch.
parse
Parses YYYY-MM-DD, rejecting dates that do not exist.