I tried Date.parse("2020-02-31");
(31st Feb. 2020) and it returns 1583107200000
or new Date("2019-02-30").toISOString().substring(0, 10);
returns '2019-03-02'
. Why such a behaviour?
Seems like all the overflow in "DD" part till 31 seems to work even when it should not.
Something like Date.parse("2020-02-32")
or Date.parse("2020-13-01")
returns a NaN
.
Note: I'm using Node.js and replicated in Google Chrome developer console.