title: How to format a time-stamp to show the date only in a grid view
body: <p>In an aspx page I am binding the labels like this:</p>
  
  <pre><code>  &lt;asp:TemplateField HeaderText="Date of Joining"&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="Label6" runat="server" Text='&lt;%# Eval("date_of_joining") %&gt;'&gt;&lt;/asp:Label&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField HeaderText="Paid Priviledge Date"&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="Label8" runat="server" 
                      Text='&lt;%# Eval("paid_priviledge_date") %&gt;'&gt;&lt;/asp:Label&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>And in the code behind I'm binding the grid view like this :(minimum code is given)</p>
  
  <pre><code>GridView1.DataSource = dt2;
  GridView1.DataBind();
  </code></pre>
  
  <p>But the gridview columns show the date like this :   </p>
  
  <pre><code>4/12/2011 12:00:00 AM    
  4/4/2011 12:00:00 AM
  </code></pre>
  
  <p>Please suggest how to remove the time stamp part and to display only the date part.</p>
  
  <p>I know how to do this by formatting using ToString and SubString. But I am not able to do this in gridview.</p>