j9_e8a
Last Updated: February 25, 2016
·
12.47K
· johnnyrodgers
8067c68c508929bc12349b850683ae33

Set timezone for your Heroku app

Heroku uses UTC by default. To change this, set your preferred timezone using the TZ Database Timezone format (http://en.wikipedia.org/wiki/List_of_tz_database_time_zones)

For example, for Pacific Time:

$ heroku config:add TZ="America/Los_Angeles"

Credit to http://blog.pardner.com/2012/08/setting-the-default-time-zone-for-a-heroku-app/

Say Thanks
Respond

2 Responses
Add your response

18032
None

Thanks for this. I can set to my local timezone but does that mean people in a different timezones will be off? Do you know how we set it so the Date will read whatever local timezone of the user?

over 1 year ago ·
18037
8067c68c508929bc12349b850683ae33

checkthemethod: What this setting controls is which timezone database records use when they are created and updated. If you set the TZ to Pacific Standard, as in the example above, then any dates and times you output in your app will be displayed in PST. To offset based on the timezone of the user, look into http://api.rubyonrails.org/classes/ActiveSupport/TimeWithZone.html. A useful article: http://www.elabs.se/blog/36-working-with-time-zones-in-ruby-on-rails.

over 1 year ago ·