Convert today's Date to DD/MM/YYYY - Node.js Date

Node.js examples for Date:Date Format

Description

Convert today's Date to DD/MM/YYYY

Demo Code

Date.prototype.today = function() {
  return ((this.getDate() < 10) ? "0" : "") + this.getDate() + "/"
      + (((this.getMonth() + 1) < 10) ? "0" : "") + (this.getMonth() + 1)
      + "/" + this.getFullYear();
};

Related Tutorials