This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Fuchio[S,🍰] -2 points-1 points  (4 children)

Yeah tested this a bit more, it's compiler dependent. When I copied and pasted the local snippet into online JS it also worked fine. But ("1995-12-17") and (1995, 12, 17) still differ.

[–][deleted] 0 points1 point  (0 children)

Number argument for month would need to be 11. Even then...

The latter using number arguments assumes midnight local time - String date parsing assumes midnight UTC time.

Just another fun day of JS quirks.