0

Since servers on Heroku run under UTC time, how do you set the cron time to run at 3am PST daily? Before you recommend the built in Heroku scheduler, I would like to keep everything inside of Resque. Also, it would be cool to leave the server time as UTC.

ImportClass:
  description: 'Import Class'
  custom_job_class: 'Class::ImportClass'
  cron: '0 3 * * *'
  queue: high
halfer
  • 19,824
  • 17
  • 99
  • 186
Chris Hough
  • 3,389
  • 3
  • 41
  • 80

1 Answers1

1

The TZ ENV variable can be added via the Heroku dashboard if you prefer. Open your app's dashboard and navigate to the 'settings' tab, then under 'config variables' click the 'reveal config vars' button. You will then be able to add TZ = America/Chicago (or whatever timezone you need).

Then set the cron accordingly

FYI: List of available tz zones are https://en.m.wikipedia.org/wiki/List_of_tz_database_time_zones

Karan Shah
  • 1,304
  • 11
  • 15
  • Thank you so much for the great discussion. Again, is the only way to change the time zone of the box or is there a way to keep UTC? I will most likely change the timezone on the box, but I was curious. – Chris Hough Jan 10 '17 at 18:05