I've tried to import an excel file with a column formated DATE by PHPExcel with Laravel 5.4. PHPExcel read the file and output date into double number. The date() function of PHP cannot convert into date for importing into database.
Is there anybody get the same issue?
Update: this is my code
Excel::filter('chunk')
->selectSheetsByIndex(1)
->load(config('excel.import.storage').$fileName)
->chunk(1000, function($rows) {
foreach ($rows as $i=>$row) {
dd($row->toArray());
}
});
The date in excel column is 03/03/2017. The output is 42797.0 So, the date() function cannot work.