9

I'm trying to change Heroku server timezone.

I've followed the steps in Why does Heroku log using the server time rather than the Rails time zone?

Executing heroku config: TZ: Atlantic/Cape_Verde

Executing heroku run bash date: Wed Jan 23 11:24:52 CVT 2013

However heroku logs --tail still shows dates with my local timezone GMT

Am I missing something? Thanks guys:)

0

3 Answers 3

9

As of version 6.15.5-1f03166

heroku config:add TZ="America/New_York"

worked for me. Make sure you run the command after navigating to the application directory. For the correctness of timezone, check this wikipedia page. For e.g. use

heroku config:add TZ="Asia/Kolkata"

to get logs in Indian Standard Time.
In case, you are not inside your project directory, Heroku-cli expects an extra flag :

heroku config:add TZ="Asia/Kolkata" --app appname

where appname is the app name present on your Heroku dashboard and not your project name.

NOTE: By default, updating timezone re-deploys your running application.

2
  • 1
    This worked for me :) I used "America/Pacific" and it's now in California time, thanks!
    – Will
    Feb 27, 2019 at 0:19
  • 1
    Note: This does not work for heroku logs, as these are always in UTC.
    – Sumit
    May 17, 2020 at 12:31
5

If you are using a Log Viewer like PaperTrail, then one additional setting is required : PaperTrail > Settings > Profile > TimeZone > DropDown of selectable TimeZones

3

Timezone for Heroku logs cannot be changed and logs will remain in UTC even if you change the dyno timezone. Which is also not recommended, timezones are best handled within your application, and for logs, the log viewer can provide timzezone setting.

Heroku addons for logging - https://elements.heroku.com/addons#logging

Source: https://help.heroku.com/JZKJJ4NC/how-do-i-set-the-timezone-on-my-dyno

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.