How to save dates in local timezone to db with rails3?

后端 未结 2 1221
悲&欢浪女
悲&欢浪女 2020-12-30 12:43

I have Rails3 application with model user and field expires_at created like this:

t.column :expires_at, :timestamp

In my database (postgres

2条回答
  •  鱼传尺愫
    2020-12-30 13:09

    For saving time in local timezone to database this has to be set in application.rb

     config.active_record.default_timezone = :local
    

提交回复
热议问题