title: Mvc read Date in editview
body: <p>i have this Model:</p>
  
  <pre><code>    [DataType(DataType.Date)]
      [DisplayFormat(DataFormatString = "{0:dd-MM-yyyy}", ApplyFormatInEditMode = true)]
      public DateTime? bday { get; set; }
  </code></pre>
  
  <p>and it works fine but when i go into edit mode it looks like this, which makes it NULL if i try to save it.</p>
  
  <p><a href="https://i.stack.imgur.com/19NcL.png" rel="nofollow noreferrer">Bday EditView</a></p>
  
  <p>i prefer to keep the Datepicker i want it to get into the format of dd-mm-yyyy. and preferable solved through my viewModel.</p>
  
  <p>View:</p>
  
  <pre><code> &lt;div class="form-group"&gt;
          @Html.LabelFor(model =&gt; model.bday, htmlAttributes: new { @class = "control-label col-md-2" })
          &lt;div class="col-md-10"&gt;
              @Html.EditorFor(model =&gt; model.bday, new { htmlAttributes = new { @class = "form-control" } })
              @Html.ValidationMessageFor(model =&gt; model.bday, "", new { @class = "text-danger" })
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>