How to verify strings are in a certain date format?
<p>How can I verify that strings are in the format <code>"dd.MM.yyyy HH:mm:ss.mmm"</code>?</p>

<p>For example:</p>

<pre>
12.01.2011 13:26:10.000
13.05.2010 22:30:20.000
</pre>

<p>should be accepted, others should be rejected.  I want to be able to do something like:</p>

<pre><code>string c = "12.01.2011 13:26:10.000";

if (string.CompareFormat(c))
{
    // do something
}
else
{
    // do something else
}
</code></pre>
