LoginSignup
32
32

More than 5 years have passed since last update.

Herokuのタイムゾーンを日本に合わせる

Last updated at Posted at 2018-01-28

準備

heroku cliをインストール

$ brew install heroku

herokuログイン

$ heroku login

タイムゾーン変更

アプリを指定してbashを起動する

heroku apps
# アプリ一覧を確認して

heroku run bash --app アプリ名
Running bash on ⬢ yaimafuni-backend... up, run.3480 (Free)
~ $ #←bashに入れた

現在の時間を確認

~ $ date
Mon May 29 12:50:21 UTC 2017

UTCになっているので、JSTに設定したい。
一旦、control + dでheroku bashを抜ける。

JSTに変更

heroku config:add TZ=Asia/Tokyo --app アプリ名
Setting TZ and restarting ⬢ アプリ名... done, v18
TZ: Asia/Tokyo

↑変更された

確認

$ date
2017年 5月29日 月曜日 21時58分08秒 JST

JSTと表示されたらOK

32
32
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
32
32