Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

herokuで日本時間を使用する

More than 5 years have passed since last update.

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

#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 #日本時間!!
shoma2da
CEO兼エンジニアしてます
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away