Last tick of the day. - CSharp System

CSharp examples for System:DateTime Day

Description

Last tick of the day.

Demo Code


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

public class Main{
        /// <summary>
        ///     Last tick of the day.
        /// </summary>
        /// <param name="date">The date.</param>
        /// <returns></returns>
        public static DateTime DayMax(this DateTime date)
        {
            return date.Date.AddDays(1).AddTicks(-1); // last tick of this day
        }
}

Related Tutorials