本文介绍了1900年以来的天数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 PHPExcel 解析的来自Excel2007
的数据,并且日期以天为单位自1900年以来.
I'm using data from Excel2007
as parsed by PHPExcel, and dates come out as days since 1900.
如何转换为YYYY-MM-DD
(或类似名称)的字符串?
How can I convert to string of YYYY-MM-DD
(or anything similar)?
推荐答案
或使用
$phpDate = PHPExcel_Shared_Date::ExcelToPHP($cell->getCalculatedValue());
将Excel/PHPExcel日期转换为PHP日期/时间戳,然后使用标准PHP date()函数进行格式化
to convert an Excel/PHPExcel date to a PHP date/timestamp, and then use standard PHP date() function for formatting
这篇关于1900年以来的天数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!