我的代码显示未处理的 ArrayIndexOutOfRangeException 异常。
public static DateTime storeTime(String date)
{
string[] dateSplit;
string[] timeSplit;
DateTime returnValue = new DateTime();
if (date == "")
return returnValue;
dateSplit = date.Split(new Char[] { 'T' });
timeSplit = dateSplit[1].Split(new Char[] { '+' }); // Exception occurs here.
timeSplit[0] = timeSplit[0].Substring(0, timeSplit[0].Length - 1);
returnValue = DateTime.ParseExact(dateSplit[0] + " " + timeSplit[0], "yyyy-MM-dd HH:mm:ss",null);
return returnValue;
}