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

Answer by Chirag for Difference in months between two dates

$
0
0

To get difference in months (both start and end inclusive), irrespective of dates:

DateTime start = new DateTime(2013, 1, 1);DateTime end = new DateTime(2014, 2, 1);var diffMonths = (end.Month + end.Year * 12) - (start.Month + start.Year * 12);

Viewing all articles
Browse latest Browse all 46

Trending Articles



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