Javascript Date shortDateString()

Description

Javascript Date shortDateString()

Date.prototype.shortDateString = function(){
    return this.getFullYear().toString() +'-' +(this.getMonth()+1).toString().lpad('0',2) + '-' + this.getDate().toString().lpad('0',2);
};



PreviousNext

Related