Year

The Year represents an entire year, starting from January 1 to December 31.

Creating a Year

>>> import when_exactly as we

>>> year = we.Year(2025)
>>> year
Year(2025)

>>> str(year)
'2025'

The Months of a Year

A Year has a .months(), which returns the Months. of the year.

>>> months = year.months()
>>> len(months)
12

>>> months[0]
Month(2025, 1)

>>> months[-2:]
Months([Month(2025, 11), Month(2025, 12)])