Gets the days in month.

   
 
using System;
public class MainClass{
        /// <summary>
        /// Gets the days in month.
        /// </summary>
        /// <param name="date">The date.</param>
        /// <returns></returns>
        public static int GetDaysInMonth(DateTime date)
        {
            return DateTime.DaysInMonth(date.Year, date.Month);
        }
}