Javascript Date formattedDate()

Description

Javascript Date formattedDate()


Date.prototype.formattedDate = function(){
  var dd   = (this.getDate() < 10 ? "0" : "") + this.getDate();
  var mm   = (this.getMonth() + 1 < 10 ? "0" : "") + (this.getMonth() + 1);
  var yyyy = this.getFullYear();
  return yyyy + '/' + mm + '/' + dd;
}



PreviousNext

Related