Hacker News new | ask | show | jobs
by PetahNZ 1696 days ago
Set the cron job to run every hour in UTC, and your application logic checks if its time to open in the configured time zone.
2 comments

So the fix to using UTC for computers and crons that only care about the local time zone is to reimplement time checking?

If youre just gonna run it every hour, you might as well while(1){ check time; do stuff; sleep 1 hour;} now there's one less dependency?

It depends on that never dying.
You also depend on cron never having a bug, and you also depend on crons working as intended, unless you also have some extra system logging your cron jobs.
Unfortunately there’s more … interesting time zones than UTC+/-xx:00, and more interesting transitions than moving an hour.

For instance, Nepal uses UTC+05:45, and the time shifted by 15 minutes in 1986 (from UTC+05:30): https://www.timeanddate.com/time/zone/nepal/kathmandu

That said, I think running every 15 minutes handles all currently-observed time zones.