title: How to remove time part from DateTime variable in MVC
body: <p>In my view I have a date field (which used for Jquery Date Picker),</p>
  
  <pre><code>@if (Model != null)
  {
    if (Model.SubmitStartDate == DateTime.MinValue)
    {
      Model.SubmitStartDate = null;
    }                    
    @Html.TextBoxFor(m =&gt; m.SubmitStartDate , new { @Id = "SubmitStartDate", @readonly = "readonly", @Value = @Model.SubmitStartDate})
  } 
  </code></pre>
  
  <p>In my Model I have :</p>
  
  <pre><code>[Required(ErrorMessage = "Please select a start date")]
  [DisplayFormat(DataFormatString = "{0:d}")]
  public DateTime? SubmitStartDate { get; set; }
  </code></pre>
  
  <p>However in UI I get <strong>10/07/2013 00:00:00</strong> on load , How can I remove the time part from this. Also I require date in the format <strong>"dd-mm-yy"</strong>. Is it possible to achieve?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I edited my code as per the answers, and I got it worked as per requirement, however I got a problem. </p>
  
  <p>When I use <code>@Html.EditorFor()</code> my <code>readonly</code> property will not work any more. I tried with <code>DisplayFor</code> too, however it doesn't make sense as I was using it for a J-query <strong>Date Picker</strong>. Is there any way I can make that field to read only?</p>
  
  <p>updated Code:</p>
  
  <pre><code>@if (Model != null)
  {
    if (Model.SubmitStartDate == DateTime.MinValue)
    {
      Model.SubmitStartDate = null;
    }                    
    @Html.EditorFor(m =&gt; m.SubmitStartDate , new { type = "date", @Id = "SubmitStartDate", @readonly = "readonly", @Value = @Model.SubmitStartDate})
  } 
  </code></pre>