Different values for Time.now when using activerecord
- by Josué Lima
I have this weird situation:
When I do on rails console Time.now or Time.zone.now I get the same values (suppose they run at the sime time: 2014-06-05 23:38:06 -0300)
But when I use Time.now in a query like: Match.where("datetime = ?", Time.now) it returns the time 3 hours ahead!
.to_sql output:
SELECT `matches`.* FROM `matches` WHERE (datetime = '2014-06-06 02:38:06')
any thoughts on that?
Rails 4
Mysql 5.5