title: In ASP.NET, how can I force the format of dates in a DropDownList to "DD/MM/YYYY"?
body: <p>I have to build a DropDownList with the dates of the last 7 days. I would like the DropDownList displays the date as "DD/MM/YYYY". So I created a list of dates:</p>
  
  <pre><code>DateTime date = DateTime.Now;
  List&lt;DateTime&gt; dates = new List&lt;DateTime&gt;();
  
  for (int i = 0; i &lt; HISTORY_LENGTH; i++)
  {
      dates.Add(date.AddDays(-i));
  }
  
  DropDownList.DataSource = dates;
  DropDownList.DataBind();
  </code></pre>
  
  <p>I add my dates as DateTime, not as strings. I think it is the method ToString() of my DateTime object that is called to create text that is visible in my DropDownList. By default it is the date and time. The result is:</p>
  
  <blockquote>
    <p>[0]: {16/07/2008 11:08:27}</p>
    
    <p>[1]: {15/07/2008 11:08:27}</p>
    
    <p>[2]: {14/07/2008 11:08:27}</p>
    
    <p>[3]: {13/07/2008 11:08:27}</p>
    
    <p>[4]: {12/07/2008 11:08:27}</p>
    
    <p>[5]: {11/07/2008 11:08:27}</p>
    
    <p>[6]: {10/07/2008 11:08:27}</p>
  </blockquote>
  
  <p>How can I force the format to "DD/MM/YYYY"?</p>