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 时间
} }
=$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 时间
} }
相关文章推荐
- FTP上传经常中断处理方法
- 从零开始机器学习实战2-Matplotlib绘图
- Php创建验证码类
- php中关于 left join 的分页显示
- php curl常见错误:SSL错误、bool(false)
- php实现图片base64加密和解密
- ThinkPHP 实现将SESSION存 mysql db方式session
- ThinkPHP 分页
- 自学php-字符串操作2
- ThinkPHP快速入门5_循环和控制输出,公共模板和模板布局
- phpstorm/webstorm/idea 出现一只刷新缓存Updating Index
- Swoole-真正的PHP Web开发框架
- PHP关于依赖注入(控制反转)的解释和例子说明
- sftp
- php中函数的实参和形参
- PHP可变变量,预定义变量,综述,$_GET数组
- PHP图片识别成文字
- install and run tftp dhcp nfs server
- 【转】CI去掉index.php
- 在PHP中使用FastCGI解析漏洞及修复方案