public LargeTimeSpan(DateTime begin, DateTime end) { Begin = begin; End = end; MonthCount = MotorUtility.MonthCountBetween(begin, end); YearCount = MonthCount / 12 /* months in year */; WeekCount = MotorUtility.WeekCountBetween(begin, end); }
static void ShowMonthsBetween(DateTime datetimeBegin, DateTime datetimeEnd) { Console.WriteLine("Months between {0} and {1} is {2}", datetimeBegin.ToString(), datetimeEnd.ToString(), MotorUtility.MonthCountBetween(datetimeBegin, datetimeEnd)); }