use .getTime()

This commit is contained in:
2026-02-06 11:26:27 +00:00
parent ef2e7d6050
commit ceffc05899

View File

@@ -27,7 +27,7 @@ app.get("/", async (c) => {
const now = new Date(); const now = new Date();
const start = new Date(now.getFullYear(), 0, 0); const start = new Date(now.getFullYear(), 0, 0);
const diff = now - start; const diff = now.getTime() - start.getTime();
const oneDay = 1000 * 60 * 60 * 24; const oneDay = 1000 * 60 * 60 * 24;
const today = Math.floor(diff / oneDay) - 1; const today = Math.floor(diff / oneDay) - 1;