Datetime.year read/write property



The Datetime.year property returns a number representing the year of the moment. Valid values are from 1601 through 30827.

Setting the year property with a value lower or higher will throw an error.

Example

-- prints the current year, for example "2021" print(sys.Datetime().year)