I am able to convert a local time in string format, to UTC time format. But when i save this utc time in my MySQL table, it is getting saved in a strange format.
t_utc = Time.parse('Mon Apr 23 03:00:23 -0700 2012').utc # => Mon Apr 23 10:00:23 UTC 2012
model_object.time_column = t_utc
model_object.save!
When I query the 'time_column' column from the table, I get
Mon, 23 Apr 2012 03:00:23 UTC +00:00
instead of,
Mon Apr 23 10:00:23 UTC 2012
The 'type' of time_column is 'DATETIME'
Rails version 3.0.9
config.time_zone = 'UTC' in environment.rb file
I have spent lot of time trying to figure the problem, but in vain.