1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
date: international Gregorian chronology & calendar support
The time::date module implements the common international Gregorian chronology,
based on the astronomically numbered proleptic Gregorian calendar and the ISO
week-numbering calendar, as per the ISO 8601 standard, and the common 24 hour
clock. It provides [[date]], a representation of civil date/time and a optimized
extension of the [[time::chrono::moment]] type.
The [[time::chrono::]] module has many useful functions which interoperate with
dates. Any [[time::chrono::]] function which accepts *moment also accepts *date.
Dates are created using [[new]], [[now]], [[localnow]], or a "from_" function.
Alternatively, the [[virtual]]+[[realize]] interface can handle indeterminate
date/time information, and construct new dates incrementally and safely.
The observer functions ([[year]], [[hour]], etc.) evaluate a date's observed
chronological values, adjusted for its associated [[locality]]. Use [[in]] to
localize a date to another locality. Consult your system's timezone database
using [[tzdb]].
For working with date/time strings, see [[parse]] and [[format]].
Date arithmetic is categorized into two:
- Timescalar, using [[time::duration]]: See [[add]], [[time::chrono::diff]].
- Chronological, using [[span]], [[step]]: See [[reckon]], [[traverse]], [[hop]],
[[truncate]].
Chronologies are irregular due to field overflows and timezone discontinuities.
These effects are mitigated with [[zflag]] and [[rflag]], which deserve careful
consideration.
|