wangxinyun1995 / blogs

用issue记录我的博客
0 stars 0 forks source link

时区问题 #24

Open wangxinyun1995 opened 5 years ago

wangxinyun1995 commented 5 years ago

config/application.rb

require_relative 'boot'

require 'rails/all'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module News
  class Application < Rails::Application
    # Initialize configuration defaults for originally generated Rails version.
    config.load_defaults 5.1
    config.time_zone = 'Beijing'
    config.active_record.default_timezone = :local
    config.i18n.locale = 'zh-CN'
    config.i18n.default_locale = 'zh-CN'
    config.encoding = "utf-8"
    config.active_support.escape_html_entities_in_json = true
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.
  end
end