How to add one day to a date in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        var dt = new DateTime(2020, 10, 7);
        
        Console.WriteLine(dt);

        dt = dt.AddDays(1);
        
        Console.WriteLine(dt);
    }
}




/*
run:

10/7/2020 12:00:00 AM
10/8/2020 12:00:00 AM

*/

 



answered Oct 7, 2020 by avibootz

Related questions

...