Skip to content

year

Year component of a date.

v = year(serial_number)

Returns the four-digit year of the date represented by serial_number.

year(date(2026, 4, 28)) % 2026
  • month — Month component of a date (1–12).
  • day — Day-of-month component of a date (1–31).
  • weekday — Day of the week.