getNow(){
let date = new Date();
let y = date.getFullYear();
let m = date.getMonth() + 1;
let d = date.getDate();
let H = date.getHours();
let mm = date.getMinutes();
let s = date.getSeconds()
m = m < 10 ? "0" + m : m;
d = d < 10 ? "0" + d : d;
H = H < 10 ? "0" + H : H;
mm = mm < 10 ? "0" + mm : mm;
s = s < 10 ? "0" + s : s;
let day = y + "-" + m + "-" + d;
let time = H + ":" + mm+":"+s;
this.day = day;
this.time = time;
},
标签:10,mm,js,获取,let,当前,time,date,day
From: https://www.cnblogs.com/pansidong/p/17500903.html