接口返回的日期时间格式中带T 前端如何应对
function dateFunction(time){ var zoneDate = new Date(time).toJSON(); var date = new Date(+new Date(zoneDate)+8*3600*1000).toISOString().replace(/T/g,' ').replace(/\.[\d]{3}Z/,''); return date; }
//自定义时间
var customTime="2021-02-01T00:00:00";
customTime= dateFunction(customTime); //2021-02-01 00:00:00
moment(this.model.startDate).format("YYYY-MM-DD")