Do NOT split string into parts! Use exact formats!
Try to use
DateTime.TryParseExact Method (System) | Microsoft Docs[
^]
See:
string str10 = "9/22/2017 18:24";
string[] formats = {"M/d/yyyy HH:mm", "M/dd/yyyy HH:mm", "MM/d/yyyy HH:mm", "MM/dd/yyyy HH:mm"};
DateTime dateSpec = DateTime.Now;
if(DateTime.TryParseExact(str10, formats, System.Globalization.CultureInfo.CurrentCulture, System.Globalization.DateTimeStyles.None, out dateSpec))
else