i had a datetimepicker named dtpBirthDate, and want to use this as a meduim for obtaining birthdate of a user, what i want to happen exactly is upon choosing the date, three(3) textboxes namely, tboxYears, tboxMonths,tboxDays would be fill up by the number of years,months,and days the user was.
here's the code:
problem is it shows how many years,months and days it takes from the selected day to now, which is not the way i really wanted to show...and also it shows in decimal numbers not whole number.thanks again...
here's the code:
Visual Basic:
Dim tStart As DateTime = Me.dtpBirthDate.Value
Dim tFinish As DateTime = Now()
Dim TotalTime As TimeSpan = tFinish.Subtract(tStart)
Dim dd As Double = TotalTime.TotalDays
Me.tboxYears.Text = ((TotalTime.TotalDays) / 365.25).ToString
Me.tboxMonths.Text = (((TotalTime.TotalDays) / 365.25) * 12).ToString
Me.tboxDays.Text = TotalTime.TotalDays.ToString
problem is it shows how many years,months and days it takes from the selected day to now, which is not the way i really wanted to show...and also it shows in decimal numbers not whole number.thanks again...
Last edited by a moderator: