Javascript Date gaFormat()

Description

Javascript Date gaFormat()

Date.prototype.gaFormat = function () {
    var dd = this.getDate();
    if (dd < 10) dd = "0" + dd;
    var MM = this.getMonth() + 1;
    if (MM < 10) MM = "0" + MM;
    var yyyy = this.getFullYear();
    return yyyy + "-" + MM + "-" + dd;
};



PreviousNext

Related