Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LC Timezone issues #16

Open
kk-min opened this issue Jan 24, 2023 · 0 comments
Open

LC Timezone issues #16

kk-min opened this issue Jan 24, 2023 · 0 comments

Comments

@kk-min
Copy link
Contributor

kk-min commented Jan 24, 2023

There seem to be some issues with getting the correct 8am to 8am interval for LC due to the timezone. dayjs() by default will show the local time, so I assume whatever server the bot is running on is running on a timezone that is not UTC+8 (UTC?) Here's some suggestions on what we can do:

(Assumes default timezone is UTC)

Take all times via UTC

  • LC resets at UTC midnight, so set the leftBound and rightBound to midnight of server date
  • submissionDate will use actual hour of submission and submitted YYYYMMDD

Use dayjs().tz plugin

  • Set the default timezone to 'Asia/Singapore' and parse all dates with .tz() (See here)
  • Use SG time values

Offset the UTC time with +8 (i.e. assume LC resets 8am at UTC time)

  • Add +8 hours to submissionDate, leftBound and rightBound
  • Almost the same as option 1, just offsetting everything by 8 to get SG time values (but it is in UTC)
  • Probably not a good idea 🤷
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant