You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
232 B
JavaScript
9 lines
232 B
JavaScript
5 years ago
|
function numeric_month(dt)
|
||
|
{
|
||
|
return (dt.getMonth() < 9 ? '0' : '') + (dt.getMonth() + 1);
|
||
|
}
|
||
|
dt = new Date();
|
||
|
console.log(numeric_month(dt));
|
||
|
|
||
|
dt = new Date(2015, 10, 1);
|
||
|
console.log(numeric_month(dt));
|