Skip to content Skip to sidebar Skip to footer

New Date() Sets Wrong Month

I want to parse a string (or even the ints) at the new Date() function, but see what happens: date = '2015-12-13' '2015-12-13' date '2015-12-13' date2 = new Date(date); Sat Dec 12

Solution 1:

Month dates start at 0 in javascript, so 0 would be January and 11 would be December in your example.


Post a Comment for "New Date() Sets Wrong Month"