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