First Date Of Year - CSharp System

CSharp examples for System:DateTime Year

Description

First Date Of Year

Demo Code


using System.Globalization;
using System;/*w  w w  .  j a va  2  s.co m*/

public class Main{
        public static DateTime FirstDateOfYear(this DateTime date)
        {
            return new DateTime(date.Year, 1, 1);
        }
}

Related Tutorials