Javascript Date Prototype Format Date as 1/6/2009

Description

Javascript Date Prototype Format Date as 1/6/2009



Date.prototype.quickDate = function() {
    return (this.getMonth()+1) + "/" + this.getDay() + "/" + this.getFullYear();
}

console.log( (new Date()).quickDate() ); // 1/6/2009 



PreviousNext

Related