标签:excel str style date obj parse rom code val
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 }
标签:excel str style date obj parse rom code val
原文地址:https://www.cnblogs.com/releasesky/p/9835810.html