2021-12-15 12:43:51 +03:00

12 lines
311 B
C#

using System;
namespace EvoCalculator.Core.Tools;
public static class Dates
{
public static int GetMonthDifference(DateTime startDate, DateTime endDate)
{
var monthsApart = 12 * (startDate.Year - endDate.Year) + startDate.Month - endDate.Month;
return Math.Abs(monthsApart);
}
}