Add DateTime and specified number of days in CSharp
Description
The following code shows how to add DateTime and specified number of days.
Example
//w ww .ja v a 2s. co m
using System;
class Class1
{
static void Main()
{
DateTime today = DateTime.Now;
DateTime answer = today.AddDays(36);
Console.WriteLine("Today: {0:dddd}", today);
Console.WriteLine("36 days from today: {0:dddd}", answer);
}
}
The code above generates the following result.