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