现在是美国东部标准时间下午 6:25,活动记录会将该时间转换为 23:45 UTC 0。Rails如何知道转换基于哪个时区?它是从浏览器区域设置还是应用程序服务器获取它?
谢谢。
# application.rb:
class Application < Rails::Application
config.time_zone = 'Eastern Time (US & Canada)'
end
#model.rb
t = (Time.now-6.hours).beginning_of_day
#Use this method in your model with create and use the different
#timing
#and it look like -5 not -6 as mine :D