title: How to set correct date format in ASP.NET Core
body: <p>I am creating webpage using asp.net core. I am trying to change the default date format from English to Swedish in the format yyyy-MM-dd</p>
  
  <p>This is my current model </p>
  
  <pre><code>[DataType(DataType.Date)]
  [Display(Name = "Required delivery date")]
  [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]
  public Nullable&lt;DateTime&gt; DelDt { get; set; }
  </code></pre>
  
  <p>This is the razorpage</p>
  
  <pre><code>&lt;td&gt;&lt;label asp-for="Order.DelDt" class="control-label "&gt;&lt;/label&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input asp-for="Order.DelDt" asp-format="{0:yyyy-MM-dd}" tabindex=17 class="form-control"&gt;&lt;/td&gt;
  </code></pre>
  
  <p>This is what it looks like</p>
  
  <p><a href="https://i.stack.imgur.com/kv5d6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kv5d6.jpg" alt="enter image description here"></a></p>
  
  <p>how can I change my code so that the date format showed in the image instead is showing the swedish date format yyyy-MM-dd</p>
  
  <p>note: I have also tried to set the html tag to html lang="sv" without success.</p>
  
  <p><a href="https://i.stack.imgur.com/ZGwhe.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZGwhe.jpg" alt="enter image description here"></a></p>