PHPExcel 当输出时间戳那样的数字时,变成这样了!该如何解决

WBOY
Release: 2016-06-13 11:45:36
Original
1256 people have browsed it

PHPExcel 当输出时间戳那样的数字时,变成这样了!!!



php那边拿到的数据就是一串数字2009061503335(时间戳)。
用PHPExcel输出后就成了2.00906E+12

我想要让它正常的显示这个时间戳,因为订单编号就是按时间戳来做的。

$PHPExcel->getActiveSheet()->getStyle('A1')->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_TEXT);
这个放进去,还是一样,什么原因?
------解决方案--------------------
查看excel,调整单元格格式,如果是导出的话,可以使字段导出为字符串,导出的时候,值前面加空格。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template