C# – Add hours or minutes to the current time

c++datetime

I want to increase time to current time.

For example, I have the time of the problem and the expected time to complete them. How can I add to it?

 (DateTime.Now.ToShortDateString() + ...)

Best Solution

You can use other variables:

DateTime otherDate = DateTime.Now.AddMinutes(25);
DateTime tomorrow = DateTime.Now.AddHours(25);