use the Add() method to add a TimeSpan to a DateTime
using System;
class MainClass {
public static void Main() {
TimeSpan myTimeSpan = new TimeSpan(1, 2, 4, 10);
DateTime myDateTime6 = DateTime.Parse("1/13/2004 23:10:30");
DateTime myDateTime7 = myDateTime6.Add(myTimeSpan);
Console.WriteLine("myTimeSpan = " + myTimeSpan);
Console.WriteLine("myDateTime6.Add(myTimeSpan) = " + myDateTime7);
}
}
Related examples in the same category