1
This commit is contained in:
parent
af9fef2fde
commit
6a6a58c944
6
utils.js
6
utils.js
@ -78,6 +78,11 @@ function getDaySeconds(time, timeZone) {
|
||||
3600 * timeZone;
|
||||
}
|
||||
|
||||
function getHourSeconds(time, timeZone) {
|
||||
const daySeconds = getDaySeconds(time, timeZone);
|
||||
return Math.floor((time - daySeconds) / 3600) * 3600;
|
||||
}
|
||||
|
||||
function formatDate(date) {
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth() + 1;//月份是从0开始的
|
||||
@ -257,6 +262,7 @@ exports.isOnlineEnv = isOnlineEnv;
|
||||
exports.getTickCount = getTickCount;
|
||||
exports.getUtcTime = getUtcTime;
|
||||
exports.getDaySeconds = getDaySeconds;
|
||||
exports.getHourSeconds = getHourSeconds;
|
||||
exports.formatDate = formatDate;
|
||||
exports.pad = pad;
|
||||
exports.randRange = randRange;
|
||||
|
Loading…
x
Reference in New Issue
Block a user