What timezone is Heroku server using?

By default Heroku will return calls for current time in UTC.

You can manually set your app’s time zone by adding a TZ environment variable via the config command. Keep in mind that you must use the tz database time zone format. For example, if you wanted to set your default time zone to US Central time you would use the following command (I’m assuming you have/use heroku toolbelt) :

heroku config:add TZ="America/Chicago"

EDIT: As treecoder points out in the comment below; 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).

NOTE: The TZ environment variable does not affect logs. See the second note here.

Leave a Comment