mirror of
https://github.com/zwpro/coupons.git
synced 2025-12-10 16:52:48 +00:00
Update index.js
获取时间拼接字符串的常量-->变量
This commit is contained in:
parent
ddfc3e1c05
commit
59d8ce6b4e
@ -5,8 +5,8 @@ function getFormatDate(ms) {
|
||||
let date = new Date();
|
||||
date.setTime(date.getTime() + ms);
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth() + 1;
|
||||
const strDate = date.getDate();
|
||||
let month = date.getMonth() + 1;
|
||||
let strDate = date.getDate();
|
||||
if (month >= 1 && month <= 9) {
|
||||
month = '0' + month;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user