How can I get the value of the year, month and/or day from the DateTimePicker if I'm trying to compute for the age?
I've tried

Dim x As String = ""
x = Date.FromOADate(Val(DateTimePicker1.ToString))
MsgBox(x)

But it only gave me 12:00 AM.
and

DateDiff(DateInterval.Year, DateTimePicker1, Now.Date)

This time it said datetimepicker1 cannot be converted to date.
Or can you recommend other ways? D:

DateTimePicker1.Value holds the selected Date

try

dim Age as date
Age = datediff(datepicker1.value,datevalue(now)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.