js 毫秒转日期

Date.prototype.toLocaleString = function() {
    return this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + this.getDate() + " " 
    + this.getHours() + ":" + this.getMinutes() + ":" + this.getSeconds();
};

var date = new Date(毫秒数).toLocaleString();

 

posted @ 2017-05-26 16:43  无知死循环  阅读(259)  评论(0编辑  收藏  举报