You are not logged in.
Pages: 1
Trying to parse string datetime values in ISO 8601 I noticed that:
- In values like 2025-10-21T21:43:08-12:00 the timezone is not parsed
- When I provide only the "-12:00" part in ParseTimeZone it returns false
- ParseTimeZone works and returns true with values like "-1200" which is not the standard ISO 8601
just for your info
Offline
As far as I can tell, it is as expected within the mORMot documentation since almost 20 years.
Internal date/time are encoded as ISO-8601 without timezone, because it is required (by convention) to be always GMT/UTC between machines.
It may be not full ISO-8601 compatible (which prefers an explicit Z), but if you really need it, you can use the twoDateTimeWithZ/woDateTimeWithZSuffix, and it will append the expected ending Z.
Using a time zone is just a wrong approach for any serialization mechanism: the time zone should be handled in the UI level, according to the real computer local time.
ParseTimeZone() is not to be used with ISO-8601, but with standard human-readable HTTP dates like in TSynSystemTime.FromHttpDateBuffer.
Offline
@ab, I full agree with you.
The mormot is a great framework and it can be used futher than just a rest framework
I come I across with a date coming from a project and I spend little time to see what happens. I just left this topic as a FYI
Thank you again for this great work
Offline
Pages: 1