title: Extract only date from gridview
body: <pre><code>DateTime date = DateTime.ParseExact(dataGridView1.Rows[i].Cells[0].Value.ToString(), "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture);
  </code></pre>
  
  <p>How do I extract only the date from this code?</p>
  
  <p>While executing it showing this</p>
  
  <pre><code>An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll
  
  Additional information: String was not recognized as a valid DateTime.
  </code></pre>