author:咔咔
wechat:fangkangfk
方法:
function formatDate(now) {
var year = now.getFullYear(),
month = now.getMonth() + 1,
date = now.getDate(),
hour = now.getHours(),
minute = now.getMinutes(),
second = now.getSeconds();
return year + "-" + month + "-" + date;
}
调用:
html+='<td>'+ formatDate(new Date(data1[i]["ue_validTime"]*1000))+'</td>';
效果: