Gets the end of month.

image_pdfimage_print
   
 
using System;
public class MainClass{
        /// <summary>
        /// Gets the end of month.
        /// </summary>
        /// <param name="date">The date.</param>
        /// <returns></returns>
        public static DateTime GetEndOfMonth(DateTime date)
        {
            return new DateTime(new DateTime(date.Year, date.Month + 1, 1).Ticks - 1);
        }
}