var str = "00:00:00 02/01/1990";
var dt = DateTime.ParseExact(str, "hh:mm:ss dd/MM/yyyy", null);
The above code is throwing an exception "String was not recognized as a valid DateTime."
I thought using ParseExact and specifying the exact format this would be okay. What is wrong with the above?
EDIT:
Solved using invariant culture. Thanks for comments.
var dt = DateTime.ParseExact(str, "HH:mm:ss dd/MM/yyyy", CultureInfo.InvariantCulture);