String was not recognized as valid Date Time
<p>The following code throws an error 'String was not recognized as valid Date Time'.</p>

<pre><code>string text = "5/17/2013 8:08:48 PM";
string timeFormat = "dd-MM-yyyy HH:mm:ss";
DateTime.ParseExact(text, timeFormat, null);
</code></pre>

<p>How to convert that text field to a DateTime?</p>

<p>I assigned the date time string to a variable just for clarification. In my scenario, The date string comes from a datetimepicker control.</p>
