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
<
You can get the cell values as string (also the date values) this way:
$sheet = $objPHPExcel->getActiveSheet();
$lastRow = $sheet->getHighestRow();
$lastColumn = $sheet->getHighestColumn();
$rows = $sheet->rangetoArray('A2:'.$lastColumn . $lastRow, NULL, True, True, False);
foreach ($rows as $row => $cols) {
foreach($cols as $col => $cell) {
echo trim($cell).'
'; // Gives the value as string
}
}