title: Why can't DateTime.ParseExact() parse "9/1/2009" using "M/d/yyyy"
body: <p>I have a string that looks like this: "9/1/2009". I want to convert it to a DateTime object (using C#).</p>
  
  <p>This works:</p>
  
  <pre><code>DateTime.Parse("9/1/2009", new CultureInfo("en-US"));
  </code></pre>
  
  <p>But I don't understand why this doesn't work:</p>
  
  <pre><code>DateTime.ParseExact("9/1/2009", "M/d/yyyy", null);
  </code></pre>
  
  <p>There's no word in the date (like "September"), and I know the specific format, so I'd rather use ParseExact (and I don't see why CultureInfo would be needed). But I keep getting the dreaded "String was not recognized as a valid DateTime" exception.</p>
  
  <p>Thanks</p>
  
  <p>A little follow up. Here are 3 approaches that work:</p>
  
  <pre><code>DateTime.ParseExact("9/1/2009", "M'/'d'/'yyyy", null);
  DateTime.ParseExact("9/1/2009", "M/d/yyyy", CultureInfo.InvariantCulture);
  DateTime.Parse("9/1/2009", new CultureInfo("en-US"));
  </code></pre>
  
  <p>And here are 3 that don't work:</p>
  
  <pre><code>DateTime.ParseExact("9/1/2009", "M/d/yyyy", CultureInfo.CurrentCulture);
  DateTime.ParseExact("9/1/2009", "M/d/yyyy", new CultureInfo("en-US"));
  DateTime.ParseExact("9/1/2009", "M/d/yyyy", null);
  </code></pre>
  
  <p>So, Parse() works with "en-US", but not ParseExact... Unexpected?</p>