javascript is creating date wrong month

No, javascript’s Date months start with 0, so 9 is a 10th month and it is October

Reference:

new Date(year, month [, day, hour, minute, second, millisecond]);

[…]

month
Integer value representing the month, beginning with 0 for January to 11 for December.

Leave a Comment