Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku Server timezone and logs time

Tags:

heroku

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:)

like image 414
KirdApe Avatar asked Jan 23 '13 12:01

KirdApe


2 Answers

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.

like image 107
YetAnotherBot Avatar answered Oct 26 '22 22:10

YetAnotherBot


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

like image 41
Rabi Avatar answered Oct 26 '22 22:10

Rabi