I\'d like to get a person\'s age from its birthday. now - birthday / 365 doesn\'t work, because some years have 366 days. I came up with the following code:
now - birthday / 365
Came up with a Rails variation of this solution
def age(dob) now = Date.today age = now.year - dob.year age -= 1 if dob > now.years_ago(age) age end