When i upload a .xls file to PHPExcel i´d like to read the raw data.
I read about using "getValue()" and it should fix it.
But not in my case.
So in .xls i have a column: 2015-10-08 11:31
When i process it with PHPExcel i got: 42285.47993055556
Because of PHPExcel reading the file first, i cannot use PHP to make a DATETIME object?!
PHP
for ($row = 2; $row <= $highestRow; ++ $row) {
$val=array();
for ($col = 0; $col < $highestColumnIndex; ++ $col) {
$cell = $worksheet->getCellByColumnAndRow($col, $row);
$val[] = $cell->getValue();
How do i solve this?
Threw the accepted answear i got this code to work for me:
for ($row = 2; $row <= $highestRow; ++ $row) {
$val=array();
for ($col = 0; $col < $highestColumnIndex; ++ $col) {
$cell = $worksheet->getCellByColumnAndRow($col, $row);
$val[] = $cell->getValue();
}//close 2nd for loop
//Create and convert xls date to php date
$val[10] = PHPExcel_Shared_Date::ExcelToPHPObject($val[10]);
$val[10] = $val[10]->format('Y-m-d H:i:s');
//query stuff...
}//close first for loop