-2

when I execute this line of code:

 DateTime dt = DateFormat("EEEE dd.MM.yyyy HH:MM").parse("Monday 01.12.2019 17:00");
 print("dt.tostring: " + dt.toString()); //2018-12-01 17:00:00.000

The date is getting parsed from 2019 to 2018.
Tried 2020 and that is getting parsed to 2019.

Looks like a bug to me. Shall I make an Issue?
Wanted to ask here to make sure.

intl: ^0.16.1

Justin
  • 367
  • 2
  • 14

1 Answers1

1
DateTime dt = DateFormat("EEEE dd.MM.yyyy HH:mm").parse("Monday 01.12.2019 17:00");

you need to use lower-case 'mm' for minutes

  • wow, nice thanks. Lel that is stupid of me, but weird that it caused a difference of exactly 1 year. – Justin Dec 01 '20 at 15:29