I am parsing a date in format yyyy-MM-dd HH:MM:SS
using DateFormat
But I am getting some other date in parsed output
final dt = '2022-02-07 05:00:11';
final datm = DateFormat('yyyy-MM-dd HH:MM:SS').parse(dt);
print ("DATE_CALC ${datm.day} - ${datm.month} - ${datm.year} ${datm.hour} : ${datm.minute} : ${datm.second} ");
Actual Output:
DATE_CALC 7 - 2 - 2021 5 : 0 : 0
Expected :
DATE_CALC 07 - 12 - 2022 05 : 00 : 11
Why I am getting some wrong date ? Am I doing anything wrong ?