Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
93
rated 0 times [  100] [ 7]  / answers: 1 / hits: 66517  / 14 Years ago, thu, may 20, 2010, 12:00:00

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;

More From » date

 Answers
20
if (currentMonth < 10) { currentMonth = '0' + currentMonth; }

[#96725] Tuesday, May 18, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
devlin

Total Points: 474
Total Questions: 113
Total Answers: 100

Location: Sweden
Member since Fri, Apr 16, 2021
3 Years ago
devlin questions
Tue, Apr 27, 21, 00:00, 3 Years ago
Sat, Oct 31, 20, 00:00, 4 Years ago
Fri, Aug 28, 20, 00:00, 4 Years ago
;