In mysql db for records:
2011-12-09 07:59:00 UTC
In ruby if I do Time.now:
2011-12-09 03:57:46 -0800
How would I do a comparison like the following? (which isn’t working)
<% if item.exp_date < Time.now %>
Expired
<% end %>
PS. It would be great if there a solution where I don’t have to assume if the DB has times stored ending in UTC or -0800
It turns out the problem was with my use of
NOW()in queries to mysql.Adding the following to
/etc/my.cnffixed the issue: