LoginSignup
31
28

More than 5 years have passed since last update.

herokuで日本時間を使用する

Posted at

まずは現在の時刻を確認。

#herokuサーバ内に接続してbashを使う
$ heroku run bash
Running `bash` attached to terminal... up, run.9742

#現在時刻を確認
~ $ date
Wed Oct  8 11:38:22 UTC 2014 #UTC!!!

上記の例だとUTCだったので日本時間(JST)に直す。

$ heroku config:add TZ=Asia/Tokyo
Setting config vars and restarting hoge... done, v26
TZ: Asia/Tokyo

もう一度確認すると直っているはずです。

#herokuサーバ内に接続してbashを使う
$ heroku run bash
Running `bash` attached to terminal... up, run.9742

#現在時刻を確認
~ $ date
Wed Oct  8 20:37:45 JST 2014 #日本時間!!
31
28
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
31
28