First Date Of Month - CSharp System

CSharp examples for System:DateTime Month

Description

First Date Of Month

Demo Code


using System.Globalization;
using System;//from   w  w  w.j  a v a  2 s  .  c  o m

public class Main{
        public static DateTime FirstDateOfMonth(this DateTime date)
        {
            return date.AddDays(date.Day*-1 + 1).Date;
        }
}

Related Tutorials