Question: how to convert string to date yyyy-mm-dd in c#?
Answer: ParseExact() format of the input string and the format string must be the same. try this: DateTime date = DateTime. ParseExact(datestring, "M/dd/yyyy h:mm:ss tt", System.