// 获取当前时间
GetCurrentTime(){
let date=new Date(),
year=date.getFullYear(),
month=date.getMonth(),
day=date.getDate(),
hour=date.getHours(),
miute=date.getMinutes(),
second=date.getSeconds();
month>=10? month=month+1:month=`0${month+1}`;
day>=10? day=day:day=`0${day}`;
hour>=10? hour=hour:hour=`0${hour}`;
miute>=10? miute=miute:miute=`0${miute}`;
second>=10? second=second:second=`0${second}`;
//xxxx年-x月-x日
this.dataForm.visitTime = `${year}-${month}-${day} ${hour}:${miute}:${second}`;
},
JavaScript获取时间展示 xxxx-xx-xx xx:xx:xx
于 2023-06-06 15:00:24 首次发布