This is a bit wierd. Parsing a text field with a valid timespan fails if I try to be precise!
const string tmp = "17:23:24";
//works
var t1 = TimeSpan.Parse(tmp);
//fails
var t2 = TimeSpan.ParseExact(tmp, "hh:mm:ss", System.Globalization.CultureInfo.InvariantCulture);
The second parse fails with an exception “Input string was not in a correct format.” from DateTime.
From the documentation:
So, the solution is to specify the format string as