user2086396 user2086396 - 2 months ago 10 Question

Get the specific text

I have to get the days between a specific date entered by the user, and the current date in a text box.

So, the simplest code as I think will be as follows:

Private Sub DateTimePicker1_ValueChanged(sender As System.Object, e As System.EventArgs) Handles DateTimePicker1.ValueChanged
TextBox1.Text = (DateTimePicker1.Value - Today).ToString

Now, suppose the user selects the date to be
02 March 2013
, then the result of this is like
but I just want the data to be like 11 i.e without the time.

I tried changing it to
, but it does not give the desired output.

I just want to calculate the number of days between today, and the user selected date in a dd or ddd or dddd manner.

Can someone guide me in the right way?


I solved it using this:

TextBox1.Text = (DateTimePicker1.Value.Date - Today.Date).Days

Just one word made so much difference.