Skip to content

Commit

Permalink
fixed timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
gnehs committed Jun 16, 2024
1 parent d9dcae8 commit e617ed6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/stepstep.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ const bot = new Composer();
const fetch = require("node-fetch");

bot.command("stepstep", async ({ reply, message }) => {
const date = new Date();
const date = new Date(
new Date().toLocaleString("en", { timeZone: "Asia/Taipei" })
);
let day = date.getDate();
if (date.getHours() < 8) day = day - 1;
const dateStr = [
Expand Down

0 comments on commit e617ed6

Please sign in to comment.