Gets the begin of month. - CSharp System

CSharp examples for System:DateTime Month

Description

Gets the begin of month.

Demo Code


using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/*www  .j  a v a 2 s .  c o m*/

public class Main{
        #region M?todos
        /// <summary>
        /// Gets the begin of month.
        /// </summary>
        /// <returns>The begin of month.</returns>
        /// <param name="value">The DateTime it self.</param>
        public static DateTime GetBeginOfMonth(this DateTime value)
        {
            return new DateTime(value.Year, value.Month, 1, 0, 0, 0, 0);
        }
}

Related Tutorials