1 transformTimestamp (timestamp) { 2 let date = new Date(parseInt(timestamp) * 1000) 3 let Year = date.getFullYear() 4 let Moth = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) 5 let Day = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) 6 let Hour = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) 7 let Minute = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) 8 let Sechond = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()) 9 let GMT = Year + '-' + Moth + '-' + Day + ' ' + Hour + ':' + Minute + ':' + Sechond 10 11 return GMT 12 },
标签:10,00,01,getMinutes,04,getSeconds,getHours,let,date From: https://www.cnblogs.com/leileig/p/17325627.html