On Oct 5, 2006, at 5:57 PM, Jonathon Bevar wrote:

Is there a simple code bite to calculate the Age of someone via the entry of there Birthday?

I would get the difference in Date.Year, and then if CurrentDate.DayOfYear is less than BirthDate.DayOfYear, then subtract one year. So, for example, today is 10/5/2006. My birthday is 7/6/1984. The difference in years is 22, and since 10/5 is > 7/6, the age is only 22. My stepbrother's birthday is 10/23/1984, and the difference in years is 22. However, since 10/5 < 10/23, he is actually only 21.

That reminds me though... I really need to remember to get a birthday card for him :)

HTH,
-Jon


--
Jonathan Johnson
[EMAIL PROTECTED]
REAL Software, Inc.


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to