Alex Rivera | Logout

The fifteenth of February isn't found

Asked 2008-10-30T22:10:05.100
11

I'm in javascript, running this in the console

d = new Date();             
d.setMonth(1);
d.setFullYear(2009);
d.setDate(15);                                  
d.toString();

outputs this:

"Sun Mar 15 2009 18:05:46 GMT-0400 (EDT)"

Why would this be happening? It seems like a browser bug.

Edit
Report

1 Answer

1
d = new Date();
d.setDate(15);                    
d.setMonth(1);
d.setFullYear(2009);                                                                 
d.toString();

This works.

answered 2008-10-30T22:15:35.103

Your Answer