DateTime.Subtract(TimeSpan t)
using System;
class MainClass
{
public static void Main()
{
DateTime myDateTime = DateTime.Parse("1/11/2004 23:10:30");
TimeSpan myTimeSpan = new TimeSpan(1, 2, 4, 10);
DateTime myDateTime7 = myDateTime.Subtract(myTimeSpan);
Console.WriteLine("myTimeSpan = " + myTimeSpan);
Console.WriteLine("myDateTime6.Subtract(myTimeSpan) = " + myDateTime7);
}
}
Related examples in the same category