difference between two dates in months c# code example
Example 1: c# calculate difference between two dates in days
(EndDate - StartDate).TotalDays //double
(EndDate.Date - StartDate.Date).Days //int
Example 2: total months between two dates c#
((date1.Year - date2.Year) * 12) + date1.Month - date2.Month