c# get the time difference between 2 datetimes in days code example
Example 1: c# calculate difference between two dates in days
(EndDate - StartDate).TotalDays //double
(EndDate.Date - StartDate.Date).Days //int
Example 2: fdifference between two date in hours c#
double dif = (greaterDate - smallerDate).TotalHours;