时间格式:/Date(1567138282927)/
js格式化为日期格式:new Date(parseInt('/Date(1567138282927)/'.substr(6, 13)));
js格式化为短日期格式:new Date(parseInt('/Date(1567138282927)/'.substr(6, 13))).toLocaleDateString();
其他格式就同理
js json 带T时间格式化//处理时间
function ChangeDateFormat(jsondate) {
var date = new Date(jsondate).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '');
}
vue.js就加一个过滤器就ok了:filters: {
formatDate: function (time) {
var date = new Date(parseInt(time.substr(6, 13))).toLocaleDateString();
return date;
}
}
使用{{item.CreateTime|formatDate}}