I am refactoring a scheduling service that I initially created using GenServers and Supervisors that on every hour reads the next jobs to be run from the database by parsing their scheduled time and their timezone field. I want to refactor this functionality to use Oban, but I stumbled upon the issue that the timestamps are saved in Postgres without timezone data.
I wanted to ask - is there a way to configure Oban jobs to store timezone data as well and use it for scheduling by, for instance, adding an additional field to the oban_jobs
table or editing the type of the scheduled_at
column? Or if there is another way to schedule Oban jobs with a timestamp in a specific timezone. Saving them in UTC is not optimal as some of them might be scheduled for a few months in the future when the DST offset is different. But timezones could theoretically change in various ways anyway.
Edit: I noticed that shifting the timezone considers the DST for the future, which I assume solves most problems. I guess the only problem then is if a timezone changes, let’s say stops using DST or changes the DST transitions, is that correct?