Weird Cell values with a date format

Topics: Developer Forum
May 7, 2013 at 8:28 AM
Edited May 7, 2013 at 8:29 AM

The project I'm working on had to be an Excel export of the sold tickets, so that's how i came across PHPExcel. It works great but now the accountant want's to have the invoice column to be a date instead of a string.

I managed that by using the following code:

$data[2] is a php timestamp.
$x is the current row.

$objPHPExcel->setActiveSheetIndex(0)->setCellValue('C'.$x, \PHPExcel_Shared_Date::PHPToExcel($data[2]));

The first 25 columns are going great but after the 25th the value in the cell transforms to a decimal number. (See the image beneath)


I'm wondering what the source of this problem is and what is the solution?

I think that the cell properties aren't set properly. Any suggestions on fixing this?