Gets the days in month.

image_pdfimage_print
   
 
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);
        }
}