12 lines
311 B
C#
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);
|
|
}
|
|
} |