Add time interval to DateTime with + in CSharp
Description
The following code shows how to add time interval to DateTime with +.
Example
using System;//from w w w . java 2s .c o m
public class MainClass{
public static void Main(String[] argv){
System.DateTime dTime = new System.DateTime(1980, 8, 5);
System.TimeSpan tSpan = new System.TimeSpan(17, 4, 2, 1);
System.DateTime result = dTime + tSpan;
System.Console.WriteLine(result);
}
}
The code above generates the following result.