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

[discussion] multiple time zone support #28

Open
eavdmeer opened this issue Oct 19, 2022 · 0 comments
Open

[discussion] multiple time zone support #28

eavdmeer opened this issue Oct 19, 2022 · 0 comments
Labels
question Further information is requested

Comments

@eavdmeer
Copy link

eavdmeer commented Oct 19, 2022

This library cannot be effectively used over multiple time zones

Currently, later supports only two possible time zone: localTime and UTC. For most use cases, this is likely enough, but I ran into a case where it is basically mostly useless. This is the situation:

  • Web server is running in Europe/Amstedam time zone, so currently UTC+2
  • On that same server, crontab is running jobs. Those are listed with crontab -l and passed to the clients
  • Clients of the web server are in either Europe/Amsterdam or Europe/Bucharest (one hour ahead of Amsterdam)

I want to run later in the client's browser to expand a full time line of all jobs that will be run in that particular day in Europe/Amsterdam. Now this presents a huge problem. I cannot use localTime, as that varies, depending on the user. I also can't use UTC as that will completely break crontab entries that run on specific week days like this :

30 0 * * 6

This is supposed to run at 00:30 every Saturday. However, 0:30 on Saturday in UTC+2 will be 22:30 on Friday in UTC, so evaluating that crontab entry in a later schedule will not run it at 0:30 UTC+2 on Saturday.

I've been trying to work around this issue. Bottom line is that you cannot evaluate crontab entries in a different time zone and get proper results. So a UTC+2 schedule cannot be evaluated in either UTC or UTC+3 successfully without breaking day-of-week support.

I believe later would benefit from an extension so it supports any time zone through something like later.date.timeZone('Europe/Amsterdam') to make sure the crontab entry gets evaluated in the correct time zone.

Edit: I am aware that expanding the crontab entries on the server would work in this case. However, this crontab has several hundred entries. This would result in many thousands of entries, thus increasing the traffic by quite a bit.

Checklist

  • [X ] I have read the documentation.
@eavdmeer eavdmeer added the question Further information is requested label Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant