50
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

herokuでタイムゾーン設定

heorkuでタイムゾーン設定

heroku側の設定で東京(UTC+9:00)にする

手順

  • 9時間ずれている状態を確認
    • heroku console が動かない場合は heroku run console を実行する
$ heroku run console
Running `console` attached to terminal... up, run.3685
Loading production environment (Rails 4.0.0.beta1)
irb(main):001:0> Time.now
=> 2013-05-04 15:53:31 +0000
  • タイムゾーンを東京(UTC+9:00)に設定
$ heroku config:add TZ=Asia/Tokyo
Setting config vars and restarting xxxxxxx...
done, v59
TZ: Asia/Tokyo
  • タイムゾーンが東京(UTC+9:00)になっていることを確認する
$ heroku run console
Running `console` attached to terminal... up, run.5395
Loading production environment (Rails 4.0.0.beta1)
irb(main):001:0> Time.now
=> 2013-05-05 00:54:25 +0900

参考

Register as a new user and use Qiita more conveniently

  1. You can follow users and tags
  2. you can stock useful information
  3. You can make editorial suggestions for articles
What you can do with signing up
50
Help us understand the problem. What are the problem?