Feb 16, 2012 10:28 PM|kmcnet|LINK
Hello Everyone and thanks for your help in advance. I am working on an application that needs to determine whether a person has passed their 18th birthday. I tried the following code:
Dim DOB As Date = "3/25/1994"
Dim TodaysDate As Date = Now().ToShortDateString
YearsOld = DateDiff(DateInterval.Month, DOB, TodaysDate)
However, when I run this code today (2/16/2012), it returns the number 18. Obviously, this person's 18th birthday has not yet passed so this code will not work. I'm not sure what the problem is. Any help would be greatly appreciated.