hello..
I am using C# windows application
i have two datetimepicker, startdate and enddate.the difference between the two datetime picker
i to want show the total no of days in text box
please help this...
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sai Sravani PoondlaPosted Apr 21, 2016, 7:23 AM
Rajeev PunhaniPosted Mar 17, 2016, 4:37 AM
Hi Sai,
Please find the below snippet
DateTime pickerDate1 = myDateTimePicker1.Value;
TimeSpan tspan = pickerDate1- pickerDate;
int differenceInDays = tspan.Days;
string differenceAsString = differenceInDays.ToString();
If the above solution is helpful then,accept the answer.