4 ms·
Is that because you want date/times in JSON? Shouldn't it include a timezone, and maybe implement ISO8601?
by gmac 9y ago
Is that because you want date/times in JSON? Shouldn't it include a timezone, and maybe implement ISO8601?
- chrisseaton 9y agoPutting it into ES won’t change the JSON standard though.
- mikewhy 9y agoWouldn't it have to? It does stand for JavaScript Object Notation after all.
- stephenhuey 9y agoThis question seems reasonably sincere enough that you could attempt to answer it rather than downvote it.
- chrisseaton 9y agoThat's where the idea came from. But it's now a completely standalone standard, with its own grammar, that just happens to be compatible with a subset of ES.
- epmatsw 9y agoEven that's not technically true. You can represent things in JSON that can't be represented in ES object literals. There's a proposal in Stage 3 to fix that though: https://github.com/tc39/proposal-json-superset https://github.com/tc39/proposal-json-superset
- rbobby 9y agoIt wouldn't... but it could open the door to updating the standard.
- rbobby 9y ago2 things I want in JSON: 1. Datetime 2. Expand the encoding to escape '<' and '>' Being able to specify a datetime as local vs utc would also be nice... so "2018/01/31 17:35:21.2222Z" for UTC and "2018/01/31 17:35:21.2222" for local. As to the actual format used... that it's just a bikeshed argument waiting to happen. I picked y/m/d for no particular reason (well... other than my ancient preference for a simple sort key). I also picked 24 hour time for no particular reason (well... other than my ancient preference for a simple sort key). No one would really care too much one way or another what the format was (so long as it was easy to generate using common server side technologies... node, php, java, .net).
- throwbsyxgsbend 9y agoYou can use Unicode escapes for < and > if you need them to be escaped. (Which is unfortunate, but defense in depth I guess.)
- gnud 9y agoIt might be nice to transfer dates as a separate type from string. But for the love of FSM, use ISO 8601 as the format! [1] 1: https://xkcd.com/1179/ https://xkcd.com/1179/