//将时间戳格式转换成年月日时分秒var date =newDate(time3);varY= date.getFullYear()+'-';varM=(date.getMonth()+1<10?'0'+(date.getMonth()+1): date.getMonth()+1)+'-';varD=(date.getDate()<10?'0'+(date.getDate()): date.getDate())+' ';var h =(date.getHours()<10?'0'+(date.getHours()): date.getHours())+':';var m =(date.getMinutes()<10?'0'+(date.getMinutes()): date.getMinutes())+':';var s =(date.getSeconds()<10?'0'+(date.getSeconds()): date.getSeconds());var strDate =Y+M+D+ h + m + s;
console.log('输出内容:', strDate)