this.form.fillingDate = new Date().toLocaleString();
年月日,想用哪个直接格式化出来就行,非常好用
let date = new Date() this.date = `${date.getFullYear() + 1}-${date.getMonth() + 1}-${date.getDate()}`;
时分秒
const now = new Date(); const hour = now.getHours(); const minute = now.getMinutes(); const second = now.getSeconds(); this.currentTime = `${hour}点${minute}分${second}秒`;