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); } }
myTimeSpan = 1.02:04:10 myDateTime6.Subtract(myTimeSpan) = 31/10/2004 9:06:20 PM