1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Railsの標準時間を日本時間に設定する方法

Posted at

この記事では、Railsの標準時間を日本時間に変更する方法を紹介します。

以下の行を追加します。

config/application.rb
config.time_zone = 'Tokyo'

行の追加場所

config/application.rb
module FreeApp
  class Application < Rails::Application
    # (以下略)
    config.load_defaults 6.0
    config.i18n.default_locale = :ja
    config.time_zone = 'Tokyo'
  end
end

追加したら、再起動をすれば反映されます。

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?