How do I count the number of days between these two dates?
start_date = Date.parse "2012-03-02 14:46:21 +0100" end_date = Date.parse "2012-04-02 14:46:21 +0200"
With the Date (and DateTime) classes you can do (end_date - start_date).to_i to get the number of days difference.
(end_date - start_date).to_i
1.4m articles
1.4m replys
5 comments
57.0k users