4 ms·
Strongly disagree about datetimes; they exist at a different semantic level and are entirely too easy to get wrong.
by sevensor 2y ago
Strongly disagree about datetimes; they exist at a different semantic level and are entirely too easy to get wrong.
- wruza 2y agoNot more than a string representing a date that gets interpreted after json.parse.
- int_19h 2y agoLuckily, we have decades of experience in e.g. SQL, and existing and well-polished ISO specs on dates that can just be used as is without reinventing the wheel.
- Sohcahtoa82 2y agoYeah, but OmegaStar still doesn't support ISO timestamps like they said they would a month ago! (Reference: https://youtu.be/y8OnoxKotPQ https://youtu.be/y8OnoxKotPQ)
- Aloisius 2y agoAs if anyone actually implements ISO 8901 correctly. JavaScript certainly doesn't.
- int_19h 2y agoJS at least implements a strict subset of it for UTC, which is still a useful starting point.
- eknkc 2y agoI mean, floating point numbers are easy to get wrong. And why care about semantics? This is a data transfer format, it should be able to represent data that is being transferred gazillion times a day. Make it raw ISO 8601 { "created_at": 2024-12-10T11:20:07Z } and do not accept any other format. I know there are way smarter people than me who can figure this out at this point. DateTimes are the number 1 reason I can not use JSON data as is (if I simply parse it into a dynamic object like JSON.parse).