Pad Month value with 0 - Node.js Date

Node.js examples for Date:Month

Description

Pad Month value with 0

Demo Code

Date.prototype.getDisplayMonth = function()
{
  return this.getMonth() > 9 ? "" : "0" + this.getMonth();
};

Related Tutorials