Problems reading Dates

Jan 15, 2008 at 9:00 PM

I have a problem reading dates from an xslx file.
For example, if I have a cell with the value 01/01/2008 that displays correctly in Excel, when I read the file with PHPExcel, that field has a numeric value: 39448
Is there any way to just get the text value of the excel date? Or to convert that number to a valid date?
I'm using this code to read the file:
$objReader = new PHPExcelReaderExcel2007();
$objPHPExcel = $objReader->load($filePath);

Thank you very much for your help.
Esteban Eid.
Jan 16, 2008 at 2:22 PM
If you do not need only data, you can use $objReader->setReadDataOnly(false); to also read in date formatting information. (which then makes it a PHP date which kan be formatted using, for examle, date()).

Another option is to manually assign a date format to that specific cell, and read it out like that.
Jan 16, 2008 at 3:21 PM
Thank you, is working now.