getTime(){
let timess = new Date();
const formTime = {
y: timess.getFullYear(),
m: timess.getMonth() + 1,
d: timess.getDate(),
h: timess.getHours(),
s: timess.getMinutes(),
ss: timess.getSeconds()
};
this.printTime = formTime.y+'-' + ("0" + (formTime.m)).slice(-2)+'-'+("0" + (formTime.d)).slice(-2)+' '+("0" + (formTime.h)).slice(-2)+':'+("0" + (formTime.s)).slice(-2)+':'+("0" + (formTime.ss)).slice(-2)
//2022-12-12 12:02:01
},
标签:02,slice,ss,timess,12,时间,formTime
From: https://www.cnblogs.com/cyapi/p/16612538.html