title: Date format in gridview
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3974481/format-date-in-bind-statement-inside-a-listview">Format Date in Bind Statement inside a ListView</a>  </p>
  </blockquote>
  
  
  
  <p>I have modified a master detail gridview example as per my requirement.  It is working fine but date format in one of cell is displaying as "12/12/2012 12:00:00 AM". I just want to show only "12/12/2012". Please help, code is as below" </p>
  
  <pre><code>&lt;asp:TemplateField HeaderText="Date of Failure" SortExpression="Failure_date" &gt;
  &lt;EditItemTemplate&gt;
  &lt;asp:TextBox ID="EditFailure_date" runat="server" Columns="20" MaxLength="50" Text='&lt;%# Bind("Failure_date") %&gt;'&gt;&lt;/asp:TextBox&gt;
  &lt;asp:RequiredFieldValidator ID="Failure_dateRequiredFieldValidator" runat="server" ControlToValidate="EditFailure_date" Display="Dynamic"  ErrorMessage="Can not be blank" SetFocusOnError="True"&gt;&lt;/asp:RequiredFieldValidator&gt;
   &lt;/EditItemTemplate&gt;
   &lt;ItemStyle HorizontalAlign="Left" VerticalAlign="Top" /&gt;
   &lt;HeaderStyle HorizontalAlign="Left" VerticalAlign="Top" /&gt;
   &lt;ItemTemplate&gt;
   &lt;asp:Label ID="Failure_date" runat="server"  Text='&lt;%# Bind("Failure_date") %&gt;' &gt;&lt;/asp:Label&gt;
   &lt;/ItemTemplate&gt;
   &lt;/asp:TemplateField&gt;  
  </code></pre>