namespace
Date
Calendar days on the proleptic Gregorian calendar (UTC). A Date is stored as a plain int: the count of days since 1970-01-01, so shifting a date by whole days is ordinary integer arithmetic and two dates subtract to a day count. Build one with Date.new, read its parts with year/month/day/weekday. Every operation is deterministic integer math — no leap seconds, no timezone, no floating point.
Date.new(year, month, day) -> intA calendar day as days-since-1970.Date.year(date) -> intThe calendar year of a date.Date.month(date) -> intThe month (1-12) of a date.Date.day(date) -> intThe day of the month (1-31) of a date.Date.weekday(date) -> intDay of the week, 0=Sunday..6=Saturday.Date.is_leap(year) -> boolTrue if the year is a leap year.Date.days_in_month(year, month) -> intNumber of days in a given month.Date.to_epoch(date) -> intMidnight UTC of the day, as a DateTime.Date.add_days(date, n) -> intThe date n days later (n may be negative).Date.diff_days(a, b) -> intWhole days from b to a (a - b).