title: DateTime.ParseExact FormatException String was not recognized as a valid DateTime
body: <p>I'm completely stumped on this one. As far as I can see the documentation and other posts on SO I've read say this should work. I must be missing something silly, but I just cannot see it.</p>
  
  <p>I get a FormatException with the message "String was not recognized as a valid DateTime." on the following line of code:</p>
  
  <pre><code>return DateTime.ParseExact(value, DateFormat, null,
                             DateTimeStyles.AllowWhiteSpaces | DateTimeStyles.AssumeUniversal);
  </code></pre>
  
  <ul>
  <li><code>value</code> is <code>"11/04/2013"</code></li>
  <li><code>DateFormat</code> is <code>"dd/MM/yyyy"</code></li>
  <li>The current culture is <code>en-GB</code></li>
  <li>I've tried various variants of <code>DateTimeStyles</code> but to no effect.</li>
  </ul>
  
  <p>My original intent was for the format <code>ddd, dd/MMM/yyyy</code> but that didn't work either (the value in that instance was <code>Tue, 30/Apr/2013</code>)</p>
  
  <p>I've also tried forcing the culture to en-GB by passing in <code>new CultureInfo("en-GB")</code> instead of the <code>null</code></p>
  
  <p>I also extracted the code into its own console application to see if there was different about the environment (ASP.NET MVC 3)</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Globalization;
  using System.Linq;
  using System.Text;
  
  namespace ConsoleApplication2
  {
      class Program
      {
          static void Main(string[] args)
          {
              var DateFormat = "dd/MM/yyyy";
              var value = "30/04/2013";
              var culture = new CultureInfo("en-GB");
              var result = DateTime.ParseExact(value, DateFormat, culture,
                             DateTimeStyles.AllowWhiteSpaces | DateTimeStyles.AssumeUniversal);
              Console.WriteLine("\"{0}\" as \"{1}\" ==&gt; {2}", value, DateFormat, result);
              Console.ReadKey();
          }
      }
  }
  </code></pre>
  
  <p>And that still gives me the same error.</p>