R
Rubymint
Can someone please advise how I can calculate someones age at a specific date?
I need the result to show in Years, Months and Days
e.g. assuming the target date is 31st January 05, someone born on 25th
January 2000 would show as 5 years, 0 months, 6 Days and someone born on 31st
January 2000 would show as 5 years, 0 months, 0 days.
The calculation needs to take care of leap years otherwise I could calculate
the difference between the date in days, divide by 365 for the number of
Years, Divide the remainder by 12 for the Months and the remainder would be
the days - BUT LEAP YEARS UPSET THIS CALCULATION!!!!
I need the result to show in Years, Months and Days
e.g. assuming the target date is 31st January 05, someone born on 25th
January 2000 would show as 5 years, 0 months, 6 Days and someone born on 31st
January 2000 would show as 5 years, 0 months, 0 days.
The calculation needs to take care of leap years otherwise I could calculate
the difference between the date in days, divide by 365 for the number of
Years, Divide the remainder by 12 for the Months and the remainder would be
the days - BUT LEAP YEARS UPSET THIS CALCULATION!!!!