Beginning Of Month - CSharp System

CSharp examples for System:DateTime Month

Description

Beginning Of Month

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//  ww  w  .j a v  a  2s .c o m

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

Related Tutorials