在把一个list转化为json格式时 发现Date=12312318767 这么一串数字 以下方法可以解决
//json日期格式转换为正常格式
function jsonDateFormat(jsonDate) {
try {
var date = new Date(parseInt(jsonDate));
var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
return date.getFullYear() + "-" + month + "-" + day;
} catch (ex) {
return "";
}
}