Skip to content

[discussion] multiple time zone supportΒ #28

@eavdmeer

Description

@eavdmeer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions