用phpexcel导,入,中目前出现2个数据格式有关问题

WBOY
Release: 2016-06-13 11:55:40
Original
1107 people have browsed it

用phpexcel导,入,中目前出现2个数据格式问题
发布出来 说有非法词组 只能截图了


------解决方案--------------------

include 'Plugin/PHPExcel/Classes/PHPExcel/IOFactory.php';<br />$excel = PHPExcel_IOFactory::load('2.xls');<br />$sheet = $excel->getActiveSheet();<br />echo $sheet->getCell('A1')->getValue(), ' ', $sheet->getCell('A2')->getValue();<br />
Copy after login
5.9335552883783E+14 41728.732916667

读出来就是这样,该如何处理?
想想再说
------解决方案--------------------
先解决时间的问题

读出的时间是天数
excel 的日期是从 1900-01-01 开始计算的(php 是从 1970-01-01)
两者间有一个天数差 25569
时间是格林威治时间
所以有
$d = 25569;<br />$t = 24 * 60 * 60;<br />echo gmdate('Y-m-d H:i:s', (41728.732916667 - $d) * $t);
Copy after login
2014-03-30 17:35:24

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