[Solved] String was not recognized as a valid DateTime even if I provide valid Date format [closed]


Try this:

string s = "10.11.2017. 0:00:00";
DateTime expireDate = DateTime.ParseExact(s, "dd.MM.yyyy. H:mm:ss", CultureInfo.InvariantCulture);

2

solved String was not recognized as a valid DateTime even if I provide valid Date format [closed]