CSharp examples for System:DateTime Month
The total months.
// Copyright by the Spark Development Network using System;// w w w. j a va 2s.com public class Main{ /// <summary> /// The total months. /// </summary> /// <param name="start">The start.</param> /// <param name="end">The end.</param> /// <returns></returns> public static int TotalMonths( this DateTime end, DateTime start ) { return ( end.Year * 12 + end.Month ) - ( start.Year * 12 + start.Month ); } }