Quantcast
Viewing all articles
Browse latest Browse all 46

Answer by Edward Brey for Difference in months between two dates

Use Noda Time:

LocalDate start = new LocalDate(2013, 1, 5);LocalDate end = new LocalDate(2014, 6, 1);Period period = Period.Between(start, end, PeriodUnits.Months);Console.WriteLine(period.Months); // 16

(example source)


Viewing all articles
Browse latest Browse all 46

Trending Articles