Why is the timezone off in delayed_job?

爱⌒轻易说出口 提交于 2019-12-01 18:15:45

The problem was in my config/application.rb as @rainkinz suggested, specifically the 2nd line:

config.time_zone = 'Central Time (US & Canada)'
config.active_record.default_timezone = 'Central Time (US & Canada)'

Apparently the default_timezone setting is deprecated after Rails 3.2.13, which I just upgraded from a few days ago.

When I changed it to only have the local time zone set:

config.time_zone = 'Central Time (US & Canada)'
#config.active_record.default_timezone = 'Central Time (US & Canada)'

This fixed the problem. All active record objects still seem to have the correct time when saved, as do delayed_jobs.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!