This question was here for other languages, so let here be one for Ruby.
How do I calculate number of complete years that have passed from a given date? As you prob
To calculate number of Years and Months between two dates, I used this function
def calculate_year_month(from_date, to_date)
num_days = (from_date - to_date).to_i
num_months = (num_days / 30)
num_years = (num_months / 12)
num_months = (num_months % 12)
return num_years.to_s + " year(s) and " + num_months.to_s + " month(s)"
end