This commit is contained in:
aozhiwei 2022-09-21 14:34:51 +08:00
parent b4c9842845
commit af9fef2fde

View File

@ -73,6 +73,11 @@ function getUtcTime() {
return Math.floor((new Date()).getTime() / 1000);
}
function getDaySeconds(time, timeZone) {
return Math.floor((time + 3600 * timeZone) / 3600 / 24) * 3600 * 24 -
3600 * timeZone;
}
function formatDate(date) {
const year = date.getFullYear();
const month = date.getMonth() + 1;//月份是从0开始的
@ -251,6 +256,7 @@ exports.throwError = throwError;
exports.isOnlineEnv = isOnlineEnv;
exports.getTickCount = getTickCount;
exports.getUtcTime = getUtcTime;
exports.getDaySeconds = getDaySeconds;
exports.formatDate = formatDate;
exports.pad = pad;
exports.randRange = randRange;