title: Change default format for DateTime parsing in ASP.NET Core
body: <p>I get a Date in an ASP.NET Core Controller like this:</p>
  
  <pre><code>public class MyController:Controller{
      public IActionResult Test(DateTime date) {
  
      }
  }
  </code></pre>
  
  <p>The framework is able to parse the date, but only in English format. When I pass <strong>04.12.2017</strong> as date parameter, I mean the 4th of december 2017. This would get parsed as english date, so my date object gets the value 12th of April 2017. I tried adding german only using <a href="https://damienbod.com/2015/10/21/asp-net-5-mvc-6-localization/" rel="noreferrer">this</a> article and also <a href="https://stackoverflow.com/questions/28981973/how-do-i-set-the-locale-for-an-asp-net-5-application/">this</a>, but without success. </p>
  
  <p>What needs to be done that ASP.NET Core automatically parse dates in the correct German format?</p>
  
  <p><strong>Update</strong>
  I Tried to set the RequestLocalizationOptions</p>
  
  <pre><code>services.Configure&lt;RequestLocalizationOptions&gt;(opts =&gt;
  {
      var supportedCultures = new[]
      {
          new CultureInfo("de-DE"),
      };
  
      opts.DefaultRequestCulture = new RequestCulture("de-DE");
      // Formatting numbers, dates, etc.
      opts.SupportedCultures = supportedCultures;
      // UI strings that we have localized.
      opts.SupportedUICultures = supportedCultures;
  });
  </code></pre>
  
  <p>Still not working. I call <em>example.com/Test?date=12.04.2017</em> and got this in my debugger:</p>
  
  <pre><code>public IActionResult Test(DateTime date) {
      string dateString = date.ToString("d"); // 04.12.2016
      string currentDateString = DateTime.Now.ToString("d"); // 14.01.2016
      return Ok();
  }
  </code></pre>