Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParseIso fails if region settings have date order of DD/MM/YYYY #9

Open
paulhickman-ec opened this issue Mar 13, 2024 · 1 comment
Open

Comments

@paulhickman-ec
Copy link

paulhickman-ec commented Mar 13, 2024

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") gives 07/02/2024 09:00:40

ParseIso("2024-03-11T17:40:00.000+08:00") gives the correct value 11/03/2024 09:40:00

@Nick-vanGemeren
Copy link

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:40 09: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).

ParseIsohas 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 haveParseIsocode 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants