I have an application that needs to display duration time which is calculated with the TimeSpan class. The representation should be formatted as: D:HH:MM:SS (D=days, HH=hours, MM=minutes, SS=seconds).
When applying the ToString method of the object it yields out the exactly what we need (including negative values). Quote from MSDN: "A string that represents the value of this
instance. The return value is of the form: [-][d.]hh:mm:ss[.ff] Items in square
brackets ([ and ]) are optional, colons and periods (: and.) are literal
The issue is the optional decimal second fraction, we don't need it.
Please advice how can we eliminate this milliseconds optional representation.
Thanking you in advance
View Complete Post