Skip to content

date

Construct a date serial number from year, month, day.

v = date(year, month, day)

Returns the serial number for the given date. Supports out-of-range values: date(2026, 13, 1) is date(2027, 1, 1); negative month and day work similarly.

Note: name-clashes with the script-mode date() (no-args, returns current date string). Excel-compatible mode dispatches based on the argument count.

date(2026, 4, 28) % serial for 2026-04-28
  • today — Today’s date as a serial date number.
  • datevalue — Parse a date string into a serial date number.
  • year — Year component of a date.
  • month — Month component of a date (1–12).
  • day — Day-of-month component of a date (1–31).