I had the same problem using postgres and thanks to user145110 for suggesting using the DateTime class instead of Time. It worked for me. I would add that although I had to change the porting to use DateTime, I could still use Time and its methods in tests that were compared with DateTime values. In other words, with this initial migration:
t.time :start_time
... and fetching using Time:
start_time = Time.now.beginning_of_day
... it was preserved normally, but, having read it later, the year was changed to 2000. Perhaps this is an old Y2K bug. Lol Instead, I just changed the migration:
t.datetime :start_time
.. and all my code worked. Even tasks like this job:
start_time = Time.zone.now.beginning_of_year.beginning_of_day
I cannot help but feel that I missed something. Others use Time to manage dates?
Monty source share