Calculate difference between two dates (number of days)?

Assuming StartDate and EndDate are of type DateTime:

(EndDate - StartDate).TotalDays

Leave a Comment