getYear function

int getYear(
  1. DateTime date
)

Returns the year from the given date.

date: The date for which the year is to be determined.

Returns an integer representing the year.

Implementation

int getYear(
  DateTime date,
) {
  return date.year;
}