title: DateTime.TryParse all possible type of dates
body: <p>I want to check if a date has a correct format. There is many possibilities of correct dates like:</p>
  
  <ul>
  <li>02.08.2010</li>
  <li>2.8.2010</li>
  <li>02.8.2010 02.08</li>
  <li>02.August</li>
  <li>...</li>
  </ul>
  
  <p>I can test each on with code like this:</p>
  
  <pre><code>if (DateTime.TryParse(DateTime.ParseExact(date, "dd.M.", 
                                new CultureInfo("sl-SI")).ToString(), out dt))
  </code></pre>
  
  <p>But then I can have 40 if statements. Is it possible to check all dates with one if statement or one loop?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Based on the answers so far, I am testing this code, but I have one more problem. What if I have just 9.2 not 9.2.2010 then this code will not work:</p>
  
  <pre><code>CultureInfo ci = CultureInfo.GetCultureInfo("sl-SI");
  string[] fmts = ci.DateTimeFormat.GetAllDateTimePatterns();
  
  if (DateTime.TryParseExact(date, fmts, ci, DateTimeStyles.AssumeLocal, out dt))
  {
      DateTime = Convert.ToDateTime(date);
      Check = true;
  }
  </code></pre>
  
  <p>Must I manually add this times or what can I do?</p>