Get Two Digit Month from Date - Node.js Date

Node.js examples for Date:Month

Description

Get Two Digit Month from Date

Demo Code


Date.prototype.getTwoDigitMonth = function() {
    return (this.getMonth() < 9) ? '0' + (this.getMonth()+1) : (this.getMonth()+1);
}

Related Tutorials