So I have string that is 24.08.2010. 21:21:21, I want to convert it to 2010-08-24 21:21:21 to be able to save it in the db.
I tried this
var input = "22.08.2010. 7:00:00";
var date = DateTime.ParseExact(input,"yy-MM-dd HH:mm:ss.fff", null);
Console.WriteLine(date);
but I get error:
System.FormatException: String was not recognized as a valid DateTime.
Anyone have idea how to convert this?