title: String was not recognized as a valid datetime exception with DateTime.PraseExact
body: <p>I want to convert date time in to a particular format and save it in to a variable of type Object , but I am facing the error as <strong>String was not recognized as a valid DateTime</strong></p>
  
  <p>below the code which I tried</p>
  
  <pre><code>string regDate = DateTime.ParseExact("05/07/2015 19:41:06 PM", "MM-dd-yyyy HH:mm tt", CultureInfo.InvariantCulture);
  </code></pre>
  
  <p>The input will be in the format of "05/07/2015 19:41:06 PM" and i want the output in the mm/dd/yyyy format with hours-mins-secs also.</p>