导入EXCEL时的日期转换
1 /// <summary> 2 /// 读取EXCEL中的日期进行转换 3 /// </summary> 4 /// <param name="objValue"></param> 5 /// <returns></returns> 6 private DateTime ConvertExcelDateTime(object objValue) { 7 if (objValue is DateTime) 8 { 9 return DateTime.Parse(objValue.ToString()); 10 } 11 else 12 { 13 string dt = DateTime.FromOADate(Convert.ToInt32(objValue)).ToString("d"); 14 return DateTime.Parse(dt.ToString()); 15 } 16 }