I just currently changed my application to use the PST time zone. However, a lot of my application has code that uses Time.now which is still stuck in UTC:
irb(main):012:0> Time.now
=> 2012-12-27 05:03:16 +0000
Time.current on the other hand, seems to have the correct timezone usage:
irb(main):013:0> Time.current
=> Wed, 26 Dec 2012 21:03:42 PST -08:00
Instead of going through my entire app and changing every instance of Time.now, does it make sense to somehow alias Time.now to use Time.current instead? Is there a better way of handling this in my application so I don’t have to modify everywhere I use Time.now since it is not using my app’s configured timezone?
From my point of view, this kind of monkey patching should be avoided: Using ‘Replace All In Path’ Time.now => Time.current is not any harder to do in almost any editor, but you save your debugging time in future hunting some weird bugs in 3rd parties or people working on the same project with your.