1
This commit is contained in:
parent
b4c9842845
commit
af9fef2fde
6
utils.js
6
utils.js
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user