title: ASP.NET format string date
body: <p>I am connecting to a database, executing a query, and putting the data in a list. I have strings that have dates like so <code>mm/dd/yyyy hour:minute:second AM or PM</code> I am looking to format this data into yyyy-mm-dd with no time.</p>
  
  <p>This is where I am assigning the data:</p>
  
  <pre><code>airportItems.ContractReceived_F = dataReader.GetValue(1).ToString();
  </code></pre>
  
  <p>how would I convert the <code>dataReader.GetValue(1).ToString();</code> to the date format I want?</p>
  
  <p>I have tried the following:</p>
  
  <pre><code>airportItems.ContractReceived_F = string.Format("{0:d}", dataReader.GetValue(1).ToString());
  </code></pre>
  
  <p>I am defining ContractReceived_F as string:</p>
  
  <pre><code>public string ContractReceived_F { get; set; }
  </code></pre>
  
  <p>and it still returned the time.</p>