title: MVC DisplayFormat Date + Time
body: <p>I'm trying to display the date in this format: <code>yyyy-MM-dd HH:mm</code>, but it doesn't work (of course <code>yyyy-MM-dd</code> works fine, problem is with time)</p>
  
  <p>MODEL:</p>
  
  <pre><code>[DataType(DataType.Date)]
  [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd HH:mm}", ApplyFormatInEditMode = true)]
  public DateTime eventstart { get; set; }
  </code></pre>
  
  <p>VIEW:</p>
  
  <pre><code>&lt;div class="form-group"&gt;
          @Html.LabelFor(model =&gt; model.eventstart, htmlAttributes: new { @class = "control-label col-md-2" })
          &lt;div class="col-md-10"&gt;
              @Html.EditorFor(model =&gt; model.eventstart, new { htmlAttributes = new { @class = "form-control" } })
              @Html.ValidationMessageFor(model =&gt; model.eventstart, "", new { @class = "text-danger" })
          &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>