Ich verwende in meinem Controller:Wie konvertiert man Char-Array in String für DateTime.Parse?
char[] arrDate = date.ToArray();
DateTime dt = DateTime.Parse(arrDate[0] + arrDate[1] + "/" +
arrDate[2] + arrDate[3] + "/" +
arrDate[4] + arrDate[5] + arrDate[6] + arrDate[7]);
den Fehler:
System.FormatException: String was not recognized as a valid DateTime.
Wie wäre es mit ['date.ToString()'] (https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings) –
Bitte sehen Sie, ob Sie die Antwort akzeptieren/upvoten können. @yashu – yacc