Can anyone guide me as to how to display on a text box the number of years and months that have past between today and the date from a calendar datepicker placed on a form from which the user will select the account opening date. I want display on the text box "This account is x years and x months old".
Here is the code that I am using, but of course is incomplete. Please correct it accordingly. Thanks.
Thanks so much!
Manuel
Here is the code that I am using, but of course is incomplete. Please correct it accordingly. Thanks.
VB.NET:
Dim Inception As Date = DateTimePicker1.Value
Dim Today As Date = DateTime.Today
Dim Span As TimeSpan = Today.Subtract(DateTimePicker1.Value)
TextBox2.Text = Span.TotalDays.ToString()
Thanks so much!
Manuel