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;
}
var ds = new Date(1476339158136);
alert(formatDate(ds));
格式化时间
最新推荐文章于 2024-01-18 16:26:52 发布