Jan 17, 2015 at 11:38 PM
Edited Jan 17, 2015 at 11:41 PM
i have a Little Problem with PHP Excel. I use folowing to convert a xls (xlsx) file to csv:
$excel = @PHPExcel_IOFactory::load($source);
$writer = PHPExcel_IOFactory::createWriter($excel, 'CSV');
unset( $excel );
Thats works fine so far...
In my XLS File is a date like 04.07.1975 and the date Format is set to dd.mm.YYYY. Excel Shows me the Date correct. but after converting in the csv it Shows 07-04-75.
Thats a real Problem, because i dont know which year is mean. 75 can be 1975 or 2075 or 1875...
Why Shows Excel the date correct, but the csv Shows wrong?
I've tried so convert all fields to "text" with folowing:
$inputFileType = PHPExcel_IOFactory::identify($source);
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load($source);
But this doesnt help...
The stringoftime function doesnt help me too, because the year is obscure...
I dont know what i can do. The only Thing is to convert the whole sheet to text in excel. But when i have a sheet with postal codes like 04478 it changes after converting to 4478. What i try, i cant find a solution....
Thanks for your help....