Javascript Date ToyyyymmddHHMMss()

Description

Javascript Date ToyyyymmddHHMMss()

Date.prototype.ToyyyymmddHHMMss = function () {
    var t = this;
    var f = function (v) {
        return (v <= 9 ? '0' : '') + v.toString();
    };/*  w w w. j ava 2s  . c o m*/
    var d = f(t.getDate()), m = f(t.getMonth() + 1), y = t.getFullYear(), h = f(t.getHours()), M = f(t.getMinutes()), s = f(t.getSeconds());
    return '' + y + '-' + m + '-' + d + ' ' + h + ":" + M + ":" + s;
};
//# sourceMappingURL=Date.js.map



PreviousNext

Related