js 毫秒转换为标准时间

function dateForm(time){
                var unixTimestamp = new Date( 1477386005*1000 );
                commonTime = unixTimestamp.toLocaleString();
            }
            Date.prototype.toLocaleString = function() {
                return this.getFullYear() + "/" + (this.getMonth() + 1) + "/" + this.getDate() + "/" + this.getHours() + ":" + this.getMinutes() + ":" + this.getSeconds();
            };

  new Data(‘毫秒数’)是标准时间,

  new Data().getTime()是把标准时间转换成毫秒数

posted @ 2017-09-25 11:30  front-gl  阅读(13287)  评论(0编辑  收藏  举报