Search This Blog

Code to find Days between two dates in C#

Code to calculate no of days between two dates

DateTime date1 = new DateTime(1986, 8, 10);

DateTime date2 = new DateTime(2011, 3, 12);

TimeSpan ts = date2 - date1;

int days = ts.TotalDays;


Submitted By Nipesh Shah @ 9/20/2011 12:39:35 PM

Link Within Related Posts Plugin for WordPress, Blogger...
There was an error in this gadget