[Rails] Rails 2.3.8 - What happens to a datetime field between a form being submitted and the controller receiving the params
I currently have a model that simply contains one datetime field:
class CreateElectricityReadings < ActiveRecord::Migration
def self.up
create_table :clocks do |t|
t.datetime :time_keeper
t.timestamps
end
end
def self.down
drop_table :clocks
end
end
If I enter the date string "13/10/2010" into this field its showing up
in the controller as params[:clock][:time_keeper] "2010-10-13 23:00:00
UTC". I've tried overloading
ActiveRecord::ConnectionAdapters::Column string_to_date(string) and
ActiveRecord::ConnectionAdapters::Column string_to_time(string) but
these seems to get hit when an object is saved not between the form
submitting and the controller receiving the params object. Where is
the mysterious 23:00:00 hours coming from? Can anyone point me to a
good piece of reference reading for how dates and times work in rails
land?
Thanks
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home