You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
This library cannot be effectively used over multiple time zones
Currently,
later
supports only two possible time zone:localTime
andUTC
. For most use cases, this is likely enough, but I ran into a case where it is basically mostly useless. This is the situation:crontab -l
and passed to the clientsI 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 uselocalTime
, as that varies, depending on the user. I also can't useUTC
as that will completely break crontab entries that run on specific week days like this :This is supposed to run at 00:30 every Saturday. However, 0:30 on Saturday in
UTC+2
will be 22:30 on Friday inUTC
, so evaluating that crontab entry in alater
schedule will not run it at 0:30UTC+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 eitherUTC
orUTC+3
successfully without breaking day-of-week support.I believe
later
would benefit from an extension so it supports any time zone through something likelater.date.timeZone('Europe/Amsterdam')
to make sure the crontab entry gets evaluated in the correct time zone.Checklist
The text was updated successfully, but these errors were encountered: