Formula to Compute One's Exact AgeDate: 05/31/2000 at 11:39:32 From: Orlando Haddock Subject: Formula/Equations Is there an equation to find a person's exact age on a given date (taking into account leap years and all)? I guess you need to set up some sort of equation like N = d + m + y where d = the day of the month, m = the month of the year, and y = the year. I tried some of the answers you have given to similar questions, but have not been able to get the right result. Please help me or point me in the right direction. Thank you so much for your time and assistance. Orlando Date: 05/31/2000 at 13:55:51 From: Doctor Rob Subject: Re: Formula/Equations Thanks for writing to Ask Dr. Math, Orlando. Yes, one's exact age in days can be computed based on the date of birth and the current date. We can assume that both dates are given in the Gregorian calendar, that in common usage today. Let [x] denote the greatest integer less than or equal to x. (In other words, [x] is the integer left when you round x down, or truncate the fractional part.) The number of leap years after 1600 and on or before the year N is given by the number of ordinary leap years [(N-1600)/4] = [N/4] - 400, less the number of centurial years [(N-1600)/100] = [N/100] - 16, plus the number of centurial leap years [(N-1600)/400] = [N/400] - 4, or: T = [N/4] - [N/100] + [N/400] - 388 If we write the year N = 100*C + D, where 0 <= D < 100, then this takes the form: T = 24*C + [C/4] + [D/4] - 388 Since on leap year the extra day is added at the end of February, we will consider the years to begin on March 1, and consider March to be the first month of year N, December the 10th month of year N, and the following January and February the 11th and 12th months of year N (although the calendar tells us they are in year N+1). Now the number of days from March 1, 1600 to March 1 of the year 100*C + D is given by: 365*(100*(C-16)+D) + T There remains the adjustment for the day and month to be made. If the number of the month using the above scheme is M, then we need to add 30*(M-1) + [(3*M-1)/5] to find the number of days from March 1 to the first of the month with number M. Then to get from the first of the month to the current date X, add X-1. Thus the number of days from March 1, 1600 to day X of month M of year 100*C + D is given by: Z = 365*(100*(C-16)+D) + 24*C + [C/4] + [D/4] + 30*M + [(3*M-1)/5] + X - 419 Trying this with April 3, 1601: C = 16, D = 1, M = 2, and X = 3, so Z = 365*(100*(16-16)+1) + 24*16 + [16/4] + [1/4] + 30*2 + [(3*2-1)/5] + 3 - 419 = 365 + 0 + 4 + 384 + 60 + 1 + 3 - 419 = 398 days = 365 + 31 + 2 days which checks. Now compute the Z values for one's date of birth and for the current date, and subtract one from the other. That will give you one's age in days. For example, if one were born October 9, 1975, the Z value for that day is Z = 137,187. Today is May 31, 2000, and its Z value is Z = 146,188. The difference is 9001 days, the exact age of this person. Now converting the age in days to an age in years, months, and days is a little bit trickier, and an ambiguity of as much as two days can occur. - Doctor Rob, The Math Forum http://mathforum.org/dr.math/ |
Search the Dr. Math Library: |
[Privacy Policy] [Terms of Use]
Ask Dr. Math^{TM}
© 1994-2013 The Math Forum
http://mathforum.org/dr.math/