Good afternoon!
I have an error while trying to convert to DateTime ,here is the code
and the error:
ArrayList al = new ArrayList();
temp_str=Line.Split(' ');
al.Add(temp_str[0]); // value="11/02/2004"
al.Add(temp_str[1]); // value="10:53:10"
temp_str2=(string[])al.ToArray(typeof(string));
temp = String.Join(" ",temp_str2);
Now I am trying to do:
date=Convert.ToDateTime(temp);
or
date=DateTime.Parse(temp);
and gives me such error during the debugging: An unhandled exception
of type 'System.FormatException' occurred in mscorlib.dll
Additional information: String was not recognized as a valid DateTime.
Can anyone explain me why? Thank you very much.