title: Using datepicker to insert date into database
body: <p>I'm new to asp.net MVC 5.
  There is a column in my database which has the type of DateTime, and I want to use datepicker to insert date into it. However, it gave me an error.
  <a href="https://i.stack.imgur.com/CDnzq.png" rel="nofollow noreferrer">the error</a></p>
  
  <p>my model is like</p>
  
  <p><code>[Display(Name = "Found Date")]
   public System.DateTime foundDate { get; set; }</code></p>
  
  <p>my view is </p>
  
  <pre><code>    &lt;div class="form-group"&gt;
          @Html.LabelFor(model =&gt; model.foundDate, htmlAttributes: new { @class = "control-label col-md-2" })
          &lt;div class="col-md-10"&gt;
              @Html.EditorFor(model =&gt; model.foundDate, new { htmlAttributes = new { @class = "form-control" } })
              @Html.ValidationMessageFor(model =&gt; model.foundDate, "", new { @class = "text-danger" })
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>script</p>
  
  <p><code>$(document).ready(function ()
  {
      $("#foundDate").datepicker( {dateformat: 'dd/MM/yyyy'} );
  });</code></p>
  
  <p>Which date format should be passed to the datetime in the database? How can I change it so that it matches the datepicker's return type?</p>
  
  <p>Any help to solve this problem would be appreciated.</p>