Create a TimeSpan
C# Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
class Program { static void Main(string[] args) { DateTime now = DateTime.Now; TimeSpan timeSpan24Hours = TimeSpan.FromHours(24); DateTime modifiedDateTime = now + timeSpan24Hours; Console.WriteLine(modifiedDateTime); Console.ReadLine(); } } |
Output: