@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)
-
Show this thread
-
Replying to @thecraigmichael
What are you testing in? > new Date('2018-01-01') 2018-01-01T00:00:00.000Z is what Node.js says.
1 reply 0 retweets 3 likes -
Replying to @BrendanEich
Oh yeah! Hmmm.. I ran into this (and subsequently tested it) in Chrome.pic.twitter.com/wVgDFN7mIC
1 reply 0 retweets 1 like -
-
Replying to @BrendanEich @domenic
This is probably (?) not surprising, but using node's inspect utility, the correct date is printed in the terminal, but not in the v8 Inspector
pic.twitter.com/jiPBYWyv6t
2 replies 0 retweets 1 like -
Both those strings represent the same date. On the left: `.toTimeString()` On the right: `toISOString()`
2 replies 0 retweets 6 likes -
craig martin Retweeted craig martin
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 …
craig martin added,
1 reply 0 retweets 1 like
Mathias Bynens Retweeted Mathias Bynens
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 …
Mathias Bynens added,
Get your daily dose of JavaScript octopus jokes by watching the -
-
Replying to @mathias @thecraigmichael and
Yay for someone working on this again! This was a huge pain point for Presto, because accepting too much breaks stuff and rejecting too much breaks stuff.
0 replies 0 retweets 3 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
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.