Tomorrow Date Without Time with Now property in C#

In this article, I would like to show the Tomorrow Date Without Time with Now property in C#.
  • 4505

In this article, I would like to show the Tomorrow Date Without Time with Now property in C#. To do that you can use AddDays Function with datetime now and today property.

DateTime Now Property

This displays the current date and time of the system, expressed as the local time. In other words the Now property returns a DateTime object that has the date and time values for right now. 

AddDays Function

This function is used to return a new system.DateTime that add the specified number of days to the value of this instance.

Example

string TodayDatewithouttime = DateTime.Now.ToString("dd/MM/yyy");

Tomorrow Date Without Time in C#

You can do it with adddays function in C#. The following is simple code for it.

using System;

using System.Collections.Generic;
using
System.Linq;
using
System.Text; 

namespace ConsoleApplication71

{
    class
Program

    {

        static void Main(string[] args)

        {

       
   Console.WriteLine("Today: {0}", DateTime.Now);

            string TomorrowDatewithouttime = DateTime.Now.AddDays(1).ToString("MM/dd/yyy");

            Console.WriteLine("Tomorrow Date without Time: {0}", TomorrowDatewithouttime);

        }

    }

}

Output

 

Tomorrow-Date-without-time-in-Csharp.jpg

 

© 2013 dotNetheaven. All rights reserved.