@node Datetime @section Datetime My datetime library, with focus on date manipulation in ways sensible for humans. So that a date-time plus one day always keep the time of day. For example, 26 mars 2022 10:00 plus 1 day would give 27 mars 2022 10:00, even though 25 hours have passed due to summer time starting (in Sweden). Note that while some of these procedures mentions timezones, almost nothing is actually done with it. @subsection Constants @defvar jan @defvarx january @defvarx feb @defvarx february @defvarx mar @defvarx mars @defvarx apr @defvarx april @defvarx may @defvarx jun @defvarx june @defvarx jul @defvarx july @defvarx aug @defvarx august @defvarx sep @defvarx september @defvarx oct @defvarx october @defvarx nov @defvarx november @defvarx dec @defvarx december Numeric constants for all months. @code{@var{jan} = 1}, @code{@var{dec} = 12}. @end defvar @defvar sun @defvarx sunday @defvarx mon @defvarx monday @defvarx tue @defvarx tuesday @defvarx wed @defvarx wednesday @defvarx thu @defvarx thursday @defvarx fri @defvarx friday @defvarx sat @defvarx saturday @anchor{sunday} Numeric constants for all weekdays. @code{@var{sunday} = 0}, @code{@var{saturday} = 6}. @end defvar @subsection Parameters and Configuration @deftp {parameter} week-start @anchor{week-start} Which weekday should be considered the first. Used for calculating week numbers, the start dates of week, and is available for UI-code and the like which wants it. @end deftp @deftp {config} week-start Configuration item, updates @xref{week-start}. @end deftp @subsection Datatypes @deftp {Immutable Record} year month day Object representing a date, without any timezone information. Given the date 2040-03-23 (in ISO-8601 format), @var{year} = 2020, @var{month} = 3 and @var{day} = 23. Values higher than those usually used are possible, but not recommended. @defun date? x Is @var{x} a date object? @end defun @defun date [#:year=0] [#:month=0] [#:day=0] Create a new date object. @end defun @defun year @defunx month @defunx day Fetch corresponding field from the date object. @end defun @end deftp @deftp {Immutable Record}