how to get the hours count between two dates in c# code example Example: fdifference between two date in hours c# double dif = (greaterDate - smallerDate).TotalHours;