Reputation: 9820
How can I find out how many hours have passed been since a record was created? I'm attempting to sort with an algorithm and I need this amount as a variable. Thanks
Schema https://gist.github.com/1324803
Upvotes: 2
Views: 561
Reputation: 12643
hours_since_creation = (Time.zone.now - @record.created_at) / 3600
Upvotes: 4