I am using the TimeSpan.ParseExact
method to parse a time span. However, why does the following fail and throw an exception?
string time = "23:10:00";
string format = "HH:mm:ss";
TimeSpan timeSpan = TimeSpan.ParseExact(time, format, CultureInfo.InvariantCulture);
Judging from the Custom Date and Time Format Strings article on MSDN, the format is correct for this input string. Any ideas?