您的位置:首页 > 编程语言 > PHP开发

PHPExcel判断与转换Excel中的日期

2015-11-10 11:13 591 查看
$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 时间
} }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: