Home Rails 设置时区,解决+8问题
Post
Cancel

Rails 设置时区,解决+8问题

在  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.