Quantcast
Channel: Difference in months between two dates - Stack Overflow
Viewing all articles
Browse latest Browse all 46

Answer by Edward Brey for Difference in months between two dates

$
0
0

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



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>