Problems with writing CSV

Topics: Developer Forum, User Forum
Feb 9, 2009 at 4:17 PM
Edited Feb 9, 2009 at 4:18 PM
Trying to convert an .xls file to CSV using the following code:

$objPHPExcel = new PHPExcel();
$objReader = PHPExcel_IOFactory::createReader('Excel5');
$objPHPExcel = $objReader->load('example.xls');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'CSV');
$objWriter->setDelimiter(';');
$objWriter->setEnclosure('');
$objWriter->save('example.csv');

And the dates in the resulting CSV file is completely messed up (looks like the cell's value at some point is converted to an integer, ending up as 0, and then passed through date() )

This is with the latest changeset, 25028, and PHP 5.2.6 on Linux (Fedora Core 10)

Files:
XLS file: http://www.pvv.ntnu.no/~jensadne/phpexcel/example.xls
resulting CSV file: http://www.pvv.ntnu.no/~jensadne/phpexcel/example.csv

Developer
Feb 9, 2009 at 5:25 PM
Fixed per work item #9206
http://www.codeplex.com/PHPExcel/WorkItem/View.aspx?WorkItemId=9206

Will be available in source code release tomorrow:
http://www.codeplex.com/PHPExcel/SourceControl/ListDownloadableCommits.aspx

Thank you for your report.

Feb 10, 2009 at 4:40 PM
Yes, using the latest snapshot the problem is solved. Thank you very much for your fast response.