Consider this gist: https://gist.github.com/752934
When converting from String to Time everything goes well. It returns as UTC. However, when you convert from time to time it returns as WEST instead of UTC (or returning self: http://api.rubyonrails.org/classes/Time.html#method-i-to_time)
Any idea on why is the time zone being changed from UTC to WEST?
Thanks in advance,
DBA
I am guessing it suffers from the same problem as DateTime.to_time. This was submitted as a bug in Ruby, but rejected. More info here:
http://redmine.ruby-lang.org/issues/show/3737
UPDATE:
https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/time/conversions.rb
Looks like API doc is out of date. There is a condition on the method to check if to_time is already defined. So looks like its not even hitting this ext method:
Here is the commit: https://github.com/rails/rails/blob/4817bf94d135c44ddfae1a30acb15de989e3c86c/activesupport/lib/active_support/core_ext/time/conversions.rb
I tested out monkey patching and it works like you would expect:
I would consider this a bug