var d = new Date(2011,1,1); alert(d);
this alert says February, while it should say January
anybody has some explanation for that ?
JavaScripts Date object zero-indexes months.
Try:
var d = new Date(2011,0,1); alert(d);
Instead.
See the documentation for more info!
2.1m questions
2.1m answers
60 comments
57.0k users