javascript is creating date wrong month

后端 未结 2 1266
花落未央
花落未央 2020-11-22 08:54

using Mozilla Firefox Firebug:

var myDate = new Date(2012, 9, 23, 0,0,0,0);
myDate;

Date {Tue Oct 23 2012 00:00:00 GMT-0400 (Eastern Dayli

2条回答
  •  遥遥无期
    2020-11-22 09:28

    In the javascript world months begin with zero! kind of weird to me. Anyhow, 9 is NOT September, but rather 9 is October.

提交回复
热议问题