Calculate the number of months difference between two dates

Please share if there any such easy methods in rails. I have dates like

date1 = Date.today
date2 = Date.today - 3.months (Example can be anything)

 Now how to get month difference as 3  (date1 - date2)

Thanks for any help
Tom

On 24 June 2010 13:29, Tom M. [email protected] wrote:

Now how to get month difference as 3  (date1 - date2)

Googling for “ruby months between two dates” gleans this as the first
result:
http://www.francisfish.com/getting_the_number_of_months_between_two_dates_in_rubyrails.htm

…and loads of other likely candidates.