I don't know about Ruby not having a Time object independent from
DateTime, as migrations allow for both types of fields in a database
and they behave differently.
I had a problem similar to yours where Rails insisted in updating Time
fields with 1st Januray 2000 and it turned out that I was trying to
input a Date Time value in a Time field (or something similar).
Try changing the type of the database field and see what happens.
On Sep 21, 7:32 am, Dan Manges <
daniel.man...@gmail.com> wrote:
> ActiveRecord doesn't have the concept of a time independent from a
> date, which is what it seems like you need. As far as I know, the Ruby
> standard library doesn't either. I would use another data type. It
> looks like in your example the minute is always 0, so you could store
> only the hour in the database. If you need minute granularity, you
> could use a decimal data type and use 9.25 for 9:15am, 13.5 for 1:30
> pm, etc.
>
> -Dan Mangeshttp://
www.dcmanges.com/blog