// No of years * 12 + no of months + (-1) if startday is greater than endDayprivatestaticintmonthDifference(DateTimestartDate,DateTimeendDate){intmonthsApart=12*(endDate.Year-startDate.Year)+endDate.Month-startDate.Month+((startDate.Day-endDate.Day>0)?-1:0);returnmonthsApart;}