how to get date from excel using PHPExcel library

前端 未结 5 1195
故里飘歌
故里飘歌 2020-12-02 17:00

I am trying to get Date from excel using PHPExcel. But I am not getting date, I am getting string value which is not seconds from 1970 .

Code I have tried is

<
5条回答
  •  -上瘾入骨i
    2020-12-02 17:51

    $cell = $excel->getActiveSheet()->getCell('B' . $i);
    $InvDate= $cell->getValue();
    $InvDate= PHPExcel_Shared_Date::ExcelToPHPObject($InvDate)->format('Y-m-d H:i:s');
    

    Try this

提交回复
热议问题