function dateFormatter(value, row, index) {
date = new Date(value);
var yy = date.getFullYear();
var MM = date.getMonth() + 1;
var dd = date.getDate();
var hh = date.getHours();
var mm = date.getMinutes();
var ss = date.getSeconds();
if (MM < 10)
MM = "0" + MM;
if (dd < 10)
dd = "0" + dd;
if (hh < 10)
hh = "0" + hh;
if (mm < 10)
mm = "0" + mm;
if (ss < 10)
ss = "0" + ss;
return "" + yy + "-" + MM + "-" + dd + " " + hh + ":" + mm + ":" + ss;
}
js中时间戳到格式化
最新推荐文章于 2024-06-14 09:31:22 发布