First Day Of Next Month - CSharp System

CSharp examples for System:DateTime Month

Description

First Day Of Next Month

Demo Code


using System.Threading.Tasks;
using System.Linq;
using System.Collections.Generic;
using System;/*from w w  w  .j a v  a2  s. c  o  m*/

public class Main{
        public static DateTime FirstDayOfNextMonth(this DateTime dt)
        {
            return dt.FirstDayOfMonth().AddMonths(1);
        }
        public static DateTime FirstDayOfMonth(this DateTime dt)
        {
            return new DateTime(dt.Year, dt.Month, 1);
        }
}

Related Tutorials