How to

negate TimeSpan value

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 timeSpan = new TimeSpan(3, 1, 0, 44);
TimeSpan result = timeSpan.Negate();

Console.WriteLine(result);
Console Output:
-3.01:00:44
Send us feedback about this snippet »



Related Snippets: