DateTime.getYear

Retrieves the year represented by @datetime in the Gregorian calendar.

class DateTime
int
getYear
()

Return Value

Type: int

the year represented by @datetime

Meta

Since

2.26