title: How to parse a string input to a DateTime?
body: <p>I've figured out how to parse the input string to a date time object. </p>
  
  <p>But if I input the string and run the method that starts the timer then stop it, I can't re edit the string input without getting a format exception.</p>
  
  <p>In testing I input: <code>"00 : 00 : 10 : 000"</code> and then start my timer and stopwatch but when I call stop to both and try to input a new value for the string, eg <code>"00 : 00 : 22 : 000"</code> it gives me the following exception:</p>
  
  <pre><code>An exception of type 'System.FormatException' occurred in mscorlib.ni.dll but was not handled in user code
  
  Additional information: String was not recognized as a valid DateTime.
  </code></pre>
  
  <p>This is how the strings are being parsed to a date time:</p>
  
  <pre><code>            //Assign text box string value to a date time variable.
              DateTime workDt = DateTime.ParseExact(wrkString.Replace(": ", ":").Replace(" :", ":"), "HH:mm:ss:fff", CultureInfo.InvariantCulture);
              DateTime restDt = DateTime.ParseExact(rstString.Replace(": ", ":").Replace(" :", ":"), "HH:mm:ss:fff", CultureInfo.InvariantCulture);
  </code></pre>
  
  <p>Is there a way to handling this type of input exception in the code or possibly an extra step I'm missing in parsing the string?</p>