I am using PHPExcel extension for read/write excel files. Now I have a problem with reading the date format from excel file. In the excel file, for the date column, the data is "12/31/2012". ie "mm/dd/yyyy".
Yii::import('application.extensions.PHPExcel'); $objPHPExcel = new PHPExcel(); $inputFileName = 'uploads/'.$filename; $objPHPExcel = PHPExcel_IOFactory::load($inputFileName); $sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true);
This is the code I am using to read the excel file. When I print the $sheetData array, the date is showing as "12-31-12". ie, "mm-dd-yy"
Note that, only some excel files are showing this strange result.
Can anybody tell me, "12/31/2012". ie "mm/dd/yyyy" field in Excel will become "12-31-12". ie, "mm-dd-yy" when I parse it. Anyone please help!