Gets the end of day. - CSharp System

CSharp examples for System:DateTime Day

Description

Gets the end of day.

Demo Code


using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//from  w ww  . j a va  2  s  .  c  o m

public class Main{
        /// <summary>
        /// Gets the end of day.
        /// </summary>
        /// <returns>The end of day.</returns>
        /// <param name="value">The DateTime it self.</param>
        public static DateTime GetEndOfDay(this DateTime value)
        {
            return value.Date.AddDays(1).AddTicks(-1);
        }
}

Related Tutorials