**//时间转换
timeFormat: function(time) {
var d = new Date(time.replace(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}).*$/, ‘$1Z’));
var year = d.getFullYear(); //年
var month = d.getMonth() + 1; //月
var day = d.getDate(); //日
var hh = d.getHours(); //时
var mm = d.getMinutes(); //分
var ss = d.getSeconds(); //秒
var clock = year + "/";
if (month < 10)
clock += "0";
clock += month + "/";
if (day < 10)
clock += "0";
clock += day + " ";
if (hh < 10)
clock += "0";
clock += hh + ":";
if (mm < 10) clock += '0';
clock += mm + ":";
if (ss < 10) clock += '0';
clock += ss;
return (clock);
},
https://www.cnblogs.com/whosMeya/p/11353552.html 参考
建议直接引入dayjs