Get Last Day In Month - CSharp System

CSharp examples for System:DateTime Month

Description

Get Last Day In Month

Demo Code


using System.Globalization;
using System;/*ww w  .  j  a  v a  2 s . co m*/

public class Main{
        public static DateTime GetLastDayInMonth(DateTime date)
        {
            return new DateTime(date.Year, date.Month, DateTime.DaysInMonth(date.Year, date.Month));
        }
}

Related Tutorials