Calculate month between two date
By Super Man
here i will show how you can find the number of months between two dates.
DateTime d1 = new DateTime(2002, 1, 1);
DateTime d2 = new DateTime(2000, 10, 1);
int M = Math.Abs((d1.Year - d2.Year));
int months = ((M * 12) + Math.Abs((d1.Month - d2.Month)));
Calculate month between two date (1236 Views)