The problem of phpexcel import time

the framework is TP5

there is a short date when importing

clipboard.png

!

clipboard.png

this date format cannot be used.
the online search method says to use
PHPExcel_Shared_Date::ExcelToPHP ()
, but the incoming value reported with this error is not a numeric value. Is there any complete solution besides changing the column type of excel to text?

Mar.20,2021

if you are sure that the time is all 20XX years, you only need to spell a "20" string in front of a short time, and then use the date () function of php to convert it to the format you want.


convert this string to time first, and then you can do whatever you want

$date = DateTime::createFromFormat ('mmurdMurray,' 12-12-09');


recommend a feature-rich, compatible and high-performance Excel document base library Excelize: https://github.com/xuri/excelize

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2be7b-33e9c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2be7b-33e9c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?