3
> e = Event.first
> e.registration_start_utc #registration_start_utc is a datetime column
=> Sat, 23 Oct 2010 06:38:00 UTC +00:00
> e.registration_start_utc.utc?
=> true
> ActiveSupport::TimeZone.find_tzinfo("America/New_York").utc_to_local(e.registration_start_utc)
=> Sat, 23 Oct 2010 02:38:00 UTC +00:00
2問題有關此:導軌utc_to_local和夏令時間
1)這是爲什麼表示 「UTC」 最後輸出 - 小時得到轉換(6 => 2),但它仍表示UTC 。爲什麼不是EST/EDT?
2)夏令時切換後紐約的偏移從-4變爲-5會發生什麼?數據庫中的值不會改變,所以我唯一的結論是,我的應用程序將開始在任何地方顯示「1:38」而不是正確的2:38?
我最關心的是#2。 #1更多的是好奇心。
謝謝!
參見[這裏](http://rubyforge.org/pipermail/tzinfo - 用戶/ 2007年9月/ 000015.html)由菲爾推理 – Zabba 2011-03-14 15:41:54