Returns the FIRST possible time unit for provided DAY in dateTime (Same as DateTime.Date) - CSharp System

CSharp examples for System:DateTime Day

Description

Returns the FIRST possible time unit for provided DAY in dateTime (Same as DateTime.Date)

Demo Code


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

public class Main{
        /// <summary>
        /// Returns the FIRST possible time unit for provided DAY in dateTime
        /// (Same as DateTime.Date)
        /// </summary>
        public static DateTime StartOfDay(this DateTime dateTime)
        {
            return dateTime.Date;
        }
}

Related Tutorials