mirror of
https://github.com/hex248/year.git
synced 2026-02-08 02:33:01 +00:00
use .getTime()
This commit is contained in:
@@ -27,7 +27,7 @@ app.get("/", async (c) => {
|
||||
|
||||
const now = new Date();
|
||||
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 today = Math.floor(diff / oneDay) - 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user