It seems that HH is not really for TimeSpan
The custom TimeSpan format specifiers do not include placeholder
separator symbols, such as the symbols that separate days from hours,
hours from minutes, or seconds from fractional seconds. Instead, these
symbols must be included in the custom format string as string
literals. For example, "dd.hh\:mm" defines a period (.) as the
separator between days and hours, and a colon (:) as the separator
between hours and minutes.
Hence the correct way would be as Jon mentioned to escape using "\" Read More
Your TimeSpan
is "17:23:24" which is in the 24 hour format and it should be parsed using HH
format and not hh
which is for 12 hour formats.
TimeSpan.ParseExact(tmp, "HH:mm:ss",System.Globalization.CultureInfo.InvariantCulture);
Check out the formats
HH
instead ofhh
(24 hr format) – UpstrokeTimeSpan
. – Vandervelde