public static void Main()
string[] values = { "6", "6:12", "00:26:30", "6:12:14", "6:12:14:45",
"6.12:14:45", "6:12:14:45.3448",
"6:12:14:45,3448", "6:34:14:45" };
foreach (string value in values)
TimeSpan ts = TimeSpan.Parse(value);
Console.WriteLine("{0} --> {1}", value, ts.ToString("c"));
catch (FormatException) {
Console.WriteLine("{0}: Bad Format", value);
catch (OverflowException) {
Console.WriteLine("{0}: Overflow", value);