Question: how to calculate years months and days between two dates in c#?
Answer: Days: endDate.Subtract(firstDate).TotalDays; or. endDate.Subtract(firstDate).Days; Months: ((endDate.Year - firstDate.Year) * 12) + (endDate.Month - firstDate.Month); Years: endDate.Year - firstDate.Year;