Link to home
Start Free TrialLog in
Avatar of Ahmad Al Raeesi
Ahmad Al RaeesiFlag for United Arab Emirates

asked on

Calculating my Age by entering Birthday Date ?

Hi I am newbie in VB.net, and I want to create application can calculate age by entering Birth date
and the result give me how old am I + month. For example: if my birthday was in 11-9-1990 then
the result must be like this; 16 year old + 11 month.
I am using this code below:  "my code will give the result 17"
Dim Birth As DateTime = CDate(TextBox1.Text)
        Dim age As Long = DateDiff(DateInterval.Year, Birth, Today)
        Birth = Birth.AddYears(CInt(age))
        TextBox2.Text = age.ToString()   ' result
ASKER CERTIFIED SOLUTION
Avatar of appari
appari
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ahmad Al Raeesi

ASKER

Thaanx it's work perfectly.