Question: how to convert date dd-mm-yyyy to yyyy-mm-dd in c#?
Answer: The format of the string representation must match a specified format exactly or an exception is thrown. You should use MM/dd/yyyy format instead. DateTime dt = DateTime. ParseExact("04/26/2016", "MM/dd/yyyy", CultureInfo.