title: Asp.net MVC DateTime error on valid dates
body: <p>I'm working on a calendar where I can create events. While using the jquery datetime picker there is no live validation error, but when I press on create there is an validation error where it states that; </p>
  
  <blockquote>
    <p>The value 'the date i filled in' is not valid for StartDateTime.</p>
  </blockquote>
  
  <p>I think that after I press create it tries to validate on a different format. I don't know which one and how I check this.</p>
  
  <p>Here you have the code that is related to creating this.</p>
  
  <p>Event model:</p>
  
  <pre><code>    public class Event
  {
      public int Id { get; set; }
      public string Subject { get; set; }
      public string Description { get; set; }
      public DateTime StartDateTime { get; set; }
      public DateTime EndDateTime { get; set; }
      public string ThemeColor { get; set; }
      public bool IsFullDay { get; set; }
  }
  </code></pre>
  
  <p>The create page:</p>
  
  <pre><code>@model BudoschoolTonNeuhaus.Models.Event
  
  @{
      ViewBag.Title = "Create";
      Layout = "~/Views/Shared/_Admin_Layout.cshtml";
  }
  &lt;div class="container"&gt;
      &lt;h2&gt;Create&lt;/h2&gt;
  
      @using (Html.BeginForm())
      {
          @Html.AntiForgeryToken()
  
          &lt;div class="form-horizontal"&gt;
              &lt;h4&gt;Event&lt;/h4&gt;
              &lt;hr /&gt;
              @Html.ValidationSummary(true, "", new { @class = "text-danger" })
              &lt;div class="form-group"&gt;
                  @Html.LabelFor(model =&gt; model.Subject, htmlAttributes: new { @class = "control-label col-md-2" })
                  &lt;div class="col-md-10"&gt;
                      @Html.EditorFor(model =&gt; model.Subject, new { htmlAttributes = new { @class = "form-control" } })
                      @Html.ValidationMessageFor(model =&gt; model.Subject, "", new { @class = "text-danger" })
                  &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                  @Html.LabelFor(model =&gt; model.Description, htmlAttributes: new { @class = "control-label col-md-2" })
                  &lt;div class="col-md-10"&gt;
                      @Html.EditorFor(model =&gt; model.Description, new { htmlAttributes = new { @class = "form-control" } })
                      @Html.ValidationMessageFor(model =&gt; model.Description, "", new { @class = "text-danger" })
                  &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                  @Html.LabelFor(model =&gt; model.StartDateTime, htmlAttributes: new { @class = "control-label col-md-2" })
                  &lt;div class="col-md-10"&gt;
                      @Html.EditorFor(model =&gt; model.StartDateTime, new { htmlAttributes = new { @class = "form-control datepicker" } })
                      @Html.ValidationMessageFor(model =&gt; model.StartDateTime, "", new { @class = "text-danger" })
                  &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                  @Html.LabelFor(model =&gt; model.EndDateTime, htmlAttributes: new { @class = "control-label col-md-2" })
                  &lt;div class="col-md-10"&gt;
                      @Html.EditorFor(model =&gt; model.EndDateTime, new { htmlAttributes = new { @class = "form-control datepicker" } })
                      @Html.ValidationMessageFor(model =&gt; model.EndDateTime, "", new { @class = "text-danger" })
                  &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                  @Html.LabelFor(model =&gt; model.ThemeColor, htmlAttributes: new { @class = "control-label col-md-2" })
                  &lt;div class="col-md-10"&gt;
                      @Html.EditorFor(model =&gt; model.ThemeColor, new { htmlAttributes = new { @class = "form-control" } })
                      @Html.ValidationMessageFor(model =&gt; model.ThemeColor, "", new { @class = "text-danger" })
                  &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                  @Html.LabelFor(model =&gt; model.IsFullDay, htmlAttributes: new { @class = "control-label col-md-2" })
                  &lt;div class="col-md-10"&gt;
                      &lt;div class="checkbox"&gt;
                          @Html.EditorFor(model =&gt; model.IsFullDay)
                          @Html.ValidationMessageFor(model =&gt; model.IsFullDay, "", new { @class = "text-danger" })
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  
  
              &lt;div class="form-group"&gt;
                  &lt;div class="col-md-offset-2 col-md-10"&gt;
                      &lt;input type="submit" value="Create" class="btn btn-default" /&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      }
  
      &lt;div&gt;
          @Html.ActionLink("Back to List", "AdminIndex")
      &lt;/div&gt;
  &lt;/div&gt;
  
  @section Scripts{
      &lt;script&gt;
          $('.datepicker').datepicker({ });
      &lt;/script&gt;
   }
  </code></pre>
  
  <p>Thanks for your help in regard</p>