const demand=Thu Apr 29 2021 16:23:29 GMT+0800;
//const demand = this.ruleForm.date2
const resDate = demand.getFullYear() + ‘-‘ + this.transTime((demand.getMonth() + 1)) + ‘-‘ + this.transTime(demand.getDate()) + ‘ ‘
const resTime = this.transTime(demand.getHours()) + ‘:‘ + this.transTime(demand.getMinutes()) + ‘:‘ + this.transTime(demand.getSeconds())
console.log(resDate+resTime)// 2021-04-29 16:23:29
时间转化 Thu Apr 29 2021 16:23:29 GMT+0800
原文:https://www.cnblogs.com/lyprecords/p/14690248.html