Home Rails 修改默认时区(railschangedefaulttimezone,locale)
Post
Cancel

Rails 修改默认时区(railschangedefaulttimezone,locale)

参考: https://stackoverflow.com/questions/6118779/how-to-change-default-timezone-for-active-record-in-rails


for Chinese user, just add two lines below to you config/application.rb :

config.active_record.default_timezone = :local
config.time_zone = 'Beijing'

This post is licensed under CC BY 4.0 by the author.