getNow() { const now = new Date() const year = now.getFullYear() // 得到年份 let month = now.getMonth() + 1// 得到月份0-11再加1 let date = now.getDate()// 得到日期 if (month < 10) month = '0' + month if (date < 10) date = '0' + date return year + '年' + month + '月' + date + '日' } |
|