Get start time of tomorrows day - CSharp System

CSharp examples for System:DateTime Day

Description

Get start time of tomorrows day

Demo Code


using System.Globalization;
using System;//  ww  w . java2s  .c o m

public class Main{
        #region Tomorrow & Yesterday

        /// <summary>
        /// Get start time of tomorrows day
        /// </summary>
        public static DateTime Tomorrow(this DateTime dateTime)
        {
            return dateTime.AddDays(1).StartOfDay();
        }
        /// <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