Open paulhickman-ec opened 7 months ago
The ParseIso method gets the wrong date if there is no : between the hours and minutes in the timezone e.g. ParseIso("2024-03-11T17:40:00.000+0800") gives 07/02/2024
09:00:4009:40:00
So, a completely different issue.
As you may have realised, the date time was shifted back 800 hours (33d 8h) to your local time zone (UTC+0).
ParseIso
has several problems parsing ISO 8601 date times, the main one being that it only supports strings with separators in the date, time and zone parts (extended format). [I'm not clear on whether ISO 8601 allows mixing of extended and basic format in one string.]
I do haveParseIso
code which will support basic format (and more) and fixes some bugs., but it is not currently in a state for release. If the issue is serious for you, I can dust it off.
Sorry: had to edit this a lot as I had the wrong cause orginally.
The ParseIso method gets the wrong date if there is no : between the hours and minutes in the timezone
e.g.
ParseIso("2024-03-11T17:40:00.000+0800")
gives07/02/2024 09:00:40
ParseIso("2024-03-11T17:40:00.000+08:00")
gives the correct value11/03/2024 09:40:00