php - PHPExcel getFormatCode Issue


I am using PHPExcel to read data from Excel. It is not giving me proper cell number format even though I set it as date ('YYYY-MM-DD') format. The code I use

$reader = new PHPExcel_Reader_Excel5();
$PHPExcel = $reader->load($file );

$format = $PHPExcel->getActiveSheet()->getStyle('A1')->getNumberFormat()->getFormatCode();

I always get General. I don't know which column is going to be date format, so that part needs to be programmatically.






means read only the raw data from the cells: don't read any of the formatting information

If you do


then PHPExcel will read the formatting as well

People are also looking for solutions to the problem: javascript - Why won't my AJAX function correctly populate a drop-down list in Internet Explorer?


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.