End Of Current month - CSharp System

CSharp examples for System:DateTime Month

Description

End Of Current month

Demo Code



public class Main{
        public static DateTime EndOfCurrentmonth(this DateTime value)
        {/*from ww  w.  j a  v  a2  s. c  om*/
            var retVal = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 01);

            retVal = retVal.AddMonths(1).AddDays(-1);
            return new DateTime(retVal.Year, retVal.Month, retVal.Day);
        }
}

Related Tutorials