get number of days between two dates c#

95

c# calculate difference between two dates in days -

(EndDate - StartDate).TotalDays //double
(EndDate.Date - StartDate.Date).Days //int

total months between two dates c# -

((date1.Year - date2.Year) * 12) + date1.Month - date2.Month

get number of days between two dates c# -

(EndDate - StartDate).TotalDays

Comments

Submit
0 Comments