Hi Jak,
You need to use TimeSpan in C# to calculate date differece as:
TimeSpan TempSpan;
DateTime DateTime1=new DateTime("2015/10/11");
DateTime DateTime2=new DateTime("2015/11/11");
TempSpan = DateTime2 - DateTime1;
int Days = TempSpan.Days;
int Hours = TempSpan.Hours;
int Minute = TempSpan.Minutes;
int Second = TempSpan.Seconds;
string Datediff = Days + " days, " + Hours + " hours, " + Minute + " minutes, " + Second + " seconds ";
string Datediff1 = TempSpan.TotalMinutes + " minutes";
where Datediff gives the date difference in days, hour, minute, and seconds and Datediff1 gives date difference in seconds.
Posted On:
27-Nov-2015 08:40