I\'m trying to parse string as DateTime but I\'m getting an error. here my code
return DateTime.ParseExact(\"01/01/0001 12:00:00 AM\", \"dd/MM/yyyy HH:mm:ss tt\"
You are trying to parse the DateTime exactly, therefore the format has to be exact
DateTime
DateTime.ParseExact("01/01/0001 12:00:00 AM", "dd/MM/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);