3 ms·
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.
by PetahNZ 5y 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.
- kymaz 5y agoSo 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?
- dbaupp 5y agoUnfortunately 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 https://www.timeanddate.com/time/zone/nepal/kathmandu That said, I think running every 15 minutes handles all currently-observed time zones.