Get month in mm format in javascript

Posted by Michael Kniskern on Stack Overflow See other posts from Stack Overflow or by Michael Kniskern
Published on 2010-05-20T22:03:13Z Indexed on 2010/05/20 22:10 UTC
Read the original article Hit count: 122

Filed under:

How do I retrieve the month from the current date in mm format? (i.e. "05")

This is my current code:

var currentDate = new Date();
var currentMonth = currentDate.getMonth() + 1;

© Stack Overflow or respective owner

Related posts about JavaScript