How to get tomorrows date in C#

2 Answers

0 votes
using System;

class Program {
    static void Main() {
        DateTime tomorrow = DateTime.Today.AddDays(1);

        Console.WriteLine(tomorrow);
    }
}



/*
run:

04/10/2025 00:00:00

*/

 



answered Apr 9, 2025 by avibootz
edited Apr 9, 2025 by avibootz
0 votes
using System;

class Program
{
    static void Main()
    {
        // Get today's date
        DateTime today = DateTime.Now;

        // Calculate tomorrow's date by adding one day
        DateTime tomorrow = today.AddDays(1);

        Console.WriteLine("Tomorrow's date is: " + tomorrow.ToString("yyyy-MM-dd"));
    }
}



/*
run:

Tomorrow's date is: 2025-04-10

*/

 



answered Apr 9, 2025 by avibootz
...