how can i convert thid date 03/01/2018 12:00 AM to 2018-03-01 in c# : i am using this code to convert a date 03/01/2018 12:00 AM to 2018-03-01 in c#
  
 DateTime startDate = DateTime.ParseExact(TextBox1.Text.ToString(),"yyyy-mm-dd",System.Globalization.CultureInfo.InvariantCulture);

 but it throw exception "string was not recognized as valid datetime"