currentTime(){
const time=Date.now();
const date=new Date(time)
const Y = date.getFullYear() + '-';
const M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
let D;
if (date.getDate() < 10) {
D = "0" + date.getDate() + " ";
} else {
D = date.getDate() + " ";
}
const h = date.getHours() + ':';
const m = date.getMinutes() + ':';
const s = date.getSeconds();
const sendTime=Y+M+D+h+m+s;
return sendTime
},
时间戳转换日期时间格式,转换为‘2022-08-30 15:18:58’格式
于 2022-08-30 15:26:29 首次发布