How to change a DateTime Format
<pre><code>List&lt;DateTime&gt; datetimerange = new List&lt;DateTime&gt;();

DateTime StartDate = Convert.ToDateTime(txtDate.Text);
DateTime EndDate = Convert.ToDateTime(TextBox1.Text);
foreach (DateTime day in EachDay(StartDate, EndDate))
{
     datetimerange.Add(day.Date);
     Session["SelectedDatess"] = datetimerange;
}
</code></pre>

<p>When I displays it to a list box the date looks like <code>8/28/2012 12:00:00</code> whereas I just want to display <code>8/28/2012</code>.</p>

<p>How can I change the format of the date to <code>MM/dd/yyyy</code>?</p>
