Commit e75ff1a0 authored by duanjinfei's avatar duanjinfei

fix function

parent b7d9c775
......@@ -38,15 +38,12 @@ const getTimestampForMidnight3AM = () => {
// 获取当前时间
const now = new Date();
// 将当前时间转换为东八区时间
const utc8Time = new Date(now.toLocaleString("en-US", { timeZone: "Asia/Shanghai" }));
// 设置为当天凌晨3点
const threeAM = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 3, 0, 0);
// 设置时间为东八区凌晨3点
utc8Time.setHours(3, 0, 0, 0);
// 返回东八区凌晨三点的时间戳(单位:秒)
return Math.floor(utc8Time.getTime() / 1000);
}
// 返回时间戳(单位:秒)
return Math.floor(threeAM.getTime() / 1000);
};
Deno.serve(async (req) => {
if (req.method === 'OPTIONS') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment