prevYear property

DateTime get prevYear

Returns DateTime object of Previous year.

final checkDate =
     DateTime.parse('2023-09-16 20:18:00.123456789z');
checkDate.prevYear;         // 16-09-2022

This will not consider time Parameters.

Implementation

DateTime get prevYear => DateTime(year - 1, month, day);