@BrendanEich ...why?
`new Date('2018-01-01') => Sun Dec 31 2017 19:00:00 GMT-0500 (EST)
So don't 0 pad month?
`new Date('2018-1-01')` => Mon Jan 01 2018 00:00:00 GMT-0500 (EST)
But then:
`new Date('2018-10-01')` => Sun Sep 30 2018 20:00:00 GMT-0400 (EST)
-
-
Oh yeah! So the node v chrome thing was a red herring. Going back to the original Q, the dates from `2018-01-31` and `2018-1-31` are inconsistent. EG `new Date('2018-9-15') .getDate() != new Date('2018-10-15') .getDate()` (whether node or chrome) Why?https://twitter.com/thecraigmichael/status/1061036620231651329 …
-
Date parsing is specified to be implementation-dependent for input strings that do not match the expected format, like this one. Similar case: https://twitter.com/mathias/status/1006913349047717888 …
@gibson042 is working to broaden the uniformly supported inputs: https://github.com/gibson042/ecma262-proposal-uniform-interchange-date-parsing …
- 1 more reply
New conversation -
-
-
Thanks -- do you know why tools differ on which to call implicitly? Seems bogus.
-
No idea, but I can see the case for either option in tooling. One is more human-readable, the other is consistent across time zones.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.
Get your daily dose of JavaScript octopus jokes by watching the