This project is archived and is in readonly mode.
Time.now doesn't respect config.time_zone
-
Geoff Buesing
- State changed from new to wontfix
This is correct behavior: Time.now is not affected by config.time_zone/Time.zone.
To get the current time in Time.zone, use Time.zone.now.
-
Jordan Brough
Thanks for the quick response. Is the reasoning for this documented anywhere? (I couldn't find it) Seems a bit unintuitive and verbose (not to mention error-prone when I forget the '.zone.').
-
Jordan Brough
The unintuitive bit being that 1.day.from_now uses config.time_zone while Time.now + 1.day doesn't.