ITADN

Setting timezone for periodic task

#1472Opendreackm 创建于 2025-11-05
D
dreackmcommented
I have a periodic task that's supposed to run every 10 seconds of every weekday from 8 am to 5pm. Its cron expression is thus : `* 8-17 * * 1-5 */10`. I did'nt realize until today that this will run in UTC while I am in Africa/Blantyre (which is 2 hours ahead). To run it in the time I expect, I am simply specifying the hour segment as UTC, i.e., `6-15`. With the native crontab, I could specify which timezone a particular entry should run in with **CRON_TZ** environment variable. How do I do something similar in this case?
5 条评论