var a = new Date(1512824570*1000);
var nian = a.getFullYear();//年
var yue = a.getMonth()+1;//月
var tian = a.getDate();//天
console.log(nian +'/'+ yue +'/'+ tian);
如何把时间戳转换为日期?
最新推荐文章于 2023-12-18 17:01:02 发布
var a = new Date(1512824570*1000);
var nian = a.getFullYear();//年
var yue = a.getMonth()+1;//月
var tian = a.getDate();//天
console.log(nian +'/'+ yue +'/'+ tian);