c# get the time difference between 2 datetimes code example Example: fdifference between two date in hours c# double dif = (greaterDate - smallerDate).TotalHours;