Update index.js

获取时间拼接字符串的常量-->变量
This commit is contained in:
yehaia1 2021-03-28 20:44:40 +08:00 committed by GitHub
parent ddfc3e1c05
commit 59d8ce6b4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}
@ -96,4 +96,4 @@ exports.main = async (event, context) => {
});
return Promise.all(sendPromises)
};
};