toDateInYear method

DateTime? toDateInYear(
  1. int setYear
)

Ignores the year of the current DateTime and returns a new DateTime with the specified setYear.

Requires month and day to be set in the current DateTime.

Implementation

DateTime? toDateInYear(int setYear) => DateTime(setYear, month, day);