Cron job in a different timezone

后端 未结 5 908
情深已故
情深已故 2020-12-31 05:27

Is there a way of setting up a cronjob for a specific timezone?

My shared hosting is in USA (Virginia) and I am in UK. If I set a cron job to be executed at 1600 hrs

5条回答
  •  爱一瞬间的悲伤
    2020-12-31 05:59

    To expand on AlexT's answer:

    CRON_TZ="Europe/London"
    

    is the answer.

    p.s. If anyone is here looking for timezone fixes for GoDaddy, I recommend putting...

    export TZ="Europe/London"
    

    ...in your .bashrc so that your console runs in your timezone.

提交回复
热议问题