diff --git a/src/schedules/EventWatchSchedule.ts b/src/schedules/EventWatchSchedule.ts index c010942..1eeafef 100644 --- a/src/schedules/EventWatchSchedule.ts +++ b/src/schedules/EventWatchSchedule.ts @@ -7,6 +7,11 @@ import { sendNotification } from '../utils/firebase-admin'; import { prisma } from '../prisma/db'; import type { Schedule } from './schedule'; import dayjs from 'dayjs'; +import utc from "dayjs/plugin/utc"; +import timezone from "dayjs/plugin/timezone"; + +dayjs.extend(utc); +dayjs.extend(timezone); export class EventWatchSchedule implements Schedule { @@ -15,7 +20,7 @@ export class EventWatchSchedule implements Schedule { constructor() {} async watchEvents() { - console.debug('nextStartTime: %s', dayjs(this.#job?.nextInvocation()).format('YYYY-MM-DD HH:mm:ss')); + console.debug('nextStartTime: %s', dayjs.tz(this.#job?.nextInvocation(), 'Asia/Tokyo').format('YYYY-MM-DD HH:mm:ss')); const events = await EventSubscribeService.getAllEvents(); events.forEach((e) => this.diffEvent(e)); } @@ -66,6 +71,6 @@ export class EventWatchSchedule implements Schedule { hour: new nodeSchedule.Range(7, 23), }, () => this.watchEvents()); this.#job = job; - console.debug('Start schedule: %s, next run at %s', job.name, dayjs(job.nextInvocation()).format('YYYY-MM-DD HH:mm:ss')); + console.debug('Start schedule: %s, next run at %s', job.name, dayjs.tz(job.nextInvocation(), 'Asia/Tokyo').format('YYYY-MM-DD HH:mm:ss')); } } \ No newline at end of file