This project is archived and is in readonly mode.
ago (ActiveSupport::CoreExtensions::Numeric::Time) does not respect current timezone
-
José Valim
Please provide a patch.
-
Roel van der Hoorn
- Tag set to 2.3.6
-
Simon Garcia
It's not a bug. Time conversions use ActiveSupport::Duration which relies on Time.current which returns Time.zone.now or Time.now depending if Time.zone_default is defined which can be done on environment.rb
-
Nathaniel Bibler
I agree with the author that this is unexpected and not a well known task that must be performed (setting Time.zone_default), but Simon's suggestion does fix the issue and makes sense to me.
-
Prem Sichanugrist (sikachu)
- Assigned user set to Prem Sichanugrist (sikachu)
- Importance changed from to Low
-
Prem Sichanugrist (sikachu)
- State changed from new to wontfix
I was so tempted to write a patch for this one. However, it seems like it was changed from
Time.nowtoTime.currentin this commit:http://github.com/rails/rails/commit/32b82e4c
So, I'd say that I'll leave it as-is. In order for
agoto return the correct time zone, you must set the correspondingconfig.time_zonein application.rb (or environment.rb in Rails 2.3)