by thom_nic · 11y ago · 0 comments
Using epoch for dates makes simple math & before/after comparison easier but requires explicit conversion during serialization.
Unfortunately from what I can tell, I-JSON doesn't appear to solve this problem (or does it??) One nice thing about BSON is they made Date types first class citizens of the format.
Epochs may not be instantly readable, but they do force everyone onto the same page.
In any case, I tend to view a timezone as a separate piece of data than the actual moment in time (but I know others have a different paradigm): datetime = accurate moment in time; timezone = the timezone for which this should be viewed, or was captured or, etc.
It's not within the scope of what I-JSON is intended to address. This is a more formally specified and slightly more constrained variation of the existing JSON spec. Adding new datatypes would mean that it would no longer be JSON.
Maybe something like "String values that match (some computationally inexpensive ISO-8601-matching regex) shall be converted to Date instances by the JSON parser" could be possible without huge compatibility issues.
I guess I was mostly using this topic to voice what I'd imagine is a common point of frustration in an otherwise great data interchange format.