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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajeev PunhaniRank #551 · 4.4K reputationPosted Mar 17, 2016, 12:37 AM EDT
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.
Sai Sravani Poondla30 reputationPosted Apr 21, 2016, 3:23 AM EDT