I'm trying to parse a string into a DateTime in flutter. On android, iOS and Web the procedure works perfectly, but on windows it keeps returning, only at midnight, the wrong time.
DateFormat('HH:mm').parse('00:25');
returns 1970-01-01 01:25:00.000
on windows, but 1970-01-01 00:25:00.000
on any other OS, while any hour >= 1 returns the right value.
If I try using parseStrict method, the following happens
DateFormat('HH:mm').parseStrict('00:25');
returns FormatException: Error parsing 00:25, invalid hour value: 0 in it with time zone offset 1:00:00.000000. Expected value between 1 and 1. Date parsed as 1970-01-01 01:25:00.000..
Thanks in advance for any help
Edit: This DateTime is in local timezone, I'm not trying to parse a UTC time. I've noticed, though, that if I add the date, the DateTime seems to get parsed properly. But I need only the time. These values are the open hours for a shop. I know that I SHOULD use TimeOfDay class, but I can't use it because it doesn't have the compareTo method, which I need for my case scenario. Anyway, I've tried Android, iOS and Web and they all parse the time properly, the only one problematic is Windows