I've two different results with the same code between two PHPExcel versions (same server, same code, same data). I've tried two ways to write in the cell, same behaviour.
PHPExcel_Cell::setValueBinder( new PHPExcel_Cell_AdvancedValueBinder() );
$sheet->getStyleByColumnAndRow($col,$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$sheet->setCellValueByColumnAndRow($col,$i,$myDate->format('Y-m-d'));
//Or this line:
//$sheet->setCellValueByColumnAndRow($col,$i,PHPExcel_Shared_开发者_如何转开发Date::stringToExcel($myDate->format('Y-m-d')));
$sheet->getStyleByColumnAndRow($col,$i)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDDSLASH);
In 1.7.4 --> dd/mm/YYYY that's what i want In 1.7.6 --> YY/m/d uglyy !!!! What's wrong with my code ? Thanks for your help S.
精彩评论