var ceshi="1597742679683";
var dateTime =new Date(ceshi);
$("#createTime").text(formatDate(dateTime));
function formatDate(now) {
var year = now.getFullYear();
var month = now.getMonth() + 1;
var date = now.getDate();
var hour = now.getHours();
var minute = now.getMinutes();
var second = now.getSeconds();
return year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second;
}
javascript时间戳和日期字符串相互转换代码(超简单)
最新推荐文章于 2023-01-12 14:37:16 发布