$curCell
=$sheet->getCell($i.$j);
//获取第j行第i列的单元格对象$curValue=$curCell->getValue();
.//获取单元格里面的值if($curCell->getDataType()==PHPExcel_Cell_DataType::TYPE_NUMERIC){$cellstyleformat=$curCell->getParent()->getStyle(
$curCell->getCoordinate() )->getNumberFormat();$formatcode=$cellstyleformat->getFormatCode();
if(strtolower($formatcode) != 'general'){$curValue=gmdate("Y-m-d
h:i:s", PHPExcel_Shared_Date::ExcelToPHP($curValue));
//转为php 时间
} }
PHPExcel判断与转换Excel中的日期
最新推荐文章于 2024-06-05 11:18:59 发布
本文介绍如何使用 PHPExcel 库来处理 PHP 中的时间格式。具体包括:获取单元格对象及值,判断单元格数据类型是否为数值型,以及将 Excel 数字格式的时间转换为 PHP 的日期时间格式。
1567

被折叠的 条评论
为什么被折叠?



