Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

How to handle DST when server runs in UTC #2316

Closed
luukfiets opened this issue Mar 7, 2022 · 0 comments
Closed

How to handle DST when server runs in UTC #2316

luukfiets opened this issue Mar 7, 2022 · 0 comments

Comments

@luukfiets
Copy link

Description

I'm trying to find out what's the best way to handle DST switches and I hope anyone could point me in the right direction. I'm using bull for fetching feeds at a set time. The backend server is set to UTC. Clients can set the time for the feed to be updated (fetched). The client is in the Europe/Amsterdam timezone, so CET in winter and CEST in summer. If the clients wants the feed to be updated each day at 06:00 this should always be 06:00 in their local timezone. Therefore, I made the code so that it subtracts the right number of hours to convert it to the right UTC hour (1 if it's currently CET, 2 if it's currently CEST).

If the clients wants the feed to be fetched at 06:00 and they set that time during the winter, 06:00 CET get's converted to 05:00 UTC and the cron runs just fine. However, if the DST is active, starting end of march, the cronjob still runs at 05:00 UTC, but this now is 07:00 CEST.

What would be the best way to handle this? I have tried playing around with the timezone (tz) property and I've looked in the cron-parser & luxon documentation as well, but I haven't been able to find out what's the best way to handle this.

Do I have to remove & add all cronjobs the day after DST started with their adjust UTC hour?

Bull version

4.7.0

Additional information

Server runs UTC, client is in Amsterdam (CET/CEST timezone).

@OptimalBits OptimalBits locked and limited conversation to collaborators Mar 8, 2022
@manast manast converted this issue into discussion #2318 Mar 8, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant