excel的时间格式是:CellType.Numeric

要判断时间还需要方法:DateUtil.IsCellDateFormatted(cell)的帮助:

示例代码如下:

ICell cell = row.GetCell(j);
if (cell.CellType == CellType.NUMERIC && DateUtil.IsCellDateFormatted(cell))
    dataRow[j] = cell.DateCellValue.ToString("yyyy/MM/dd");
else 
{
    dataRow[j] = row.GetCell(j).ToString();
}

  

相关文章:

  • 2022-12-23
  • 2021-09-29
  • 2022-12-23
  • 2021-08-13
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2021-11-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-02
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案