JavaScript's getDate returns wrong date

Posted by Anubis on Stack Overflow See other posts from Stack Overflow or by Anubis
Published on 2010-03-21T19:03:50Z Indexed on 2010/03/21 19:11 UTC
Read the original article Hit count: 287

Filed under:

The following script returns 20 instead of 21!

var d = new Date("2010/03/21");
document.write(d.getDate());

What am I doing wrong? Is this a JavaScript bug?

© Stack Overflow or respective owner

Related posts about JavaScript