getCurrentTime() {
//获取当前时间并打印
var that = this;
let yy = new Date().getFullYear();
var mm = new Date().getMonth() < 9 ? "0" + (new Date().getMonth() + 1) : new Date().getMonth() + 1;
var dd = new Date().getDate() <= 9 ? "0" + new Date().getDate() : new Date().getDate();
let hh = new Date().getHours();
let mf = new Date().getMinutes()<10 ? '0'+new Date().getMinutes() : new Date().getMinutes();
let ss = new Date().getSeconds()<10 ? '0'+new Date().getSeconds() : new Date().getSeconds();
that.gettime = yy+'-'+mm+'-'+dd+' '+hh+':'+mf+':'+ss;
}
获取当前时间
最新推荐文章于 2023-09-13 14:02:53 发布