How to

subtract TimeSpan from TimeSpan

Published: 24. October 2011 | Updated: 26. October 2011
License: Microsoft Public License (MS-PL)
Categories: Framework » DateTime & TimeSpan
Tags: C# DateTime Math
Was this snippet helpful for you? YESYES / NONO
TimeSpan timeSpan1 = new TimeSpan(3, 1, 0, 44);
TimeSpan timeSpan2 = new TimeSpan(1, 14, 7, 20);

TimeSpan result = timeSpan1.Subtract(timeSpan2);

Console.WriteLine(result);
Console Output:
1.10:53:24
Send us feedback about this snippet »



Related Snippets: