problem with the return value of PHPExcel_Cell_DataType dataTypeForValue()

Topics: Developer Forum, Project Management Forum, User Forum
Sep 8, 2009 at 12:55 PM

hi to all! i don't know if someone already posted this topic. sorry if that's the case.

i'm encountering somehow a problem with the return value of the PHPExcel_Cell_DataType dataTypeForvalue().

i parsed a cell which is in date format but the function returns general.

somehow i think there's a problem with this function. anyone know why is this happening?

here's the part of my code:

                   $reader = new PHPExcel_IOFactory::createReader('Excel5'); //my file is in excel 2003 so i used excel 5

                   $obj = $reader->('myexcel.xls'); //my file

                   $type = new PHPExcel_Cell_DataType();

                   $data = $type->dataTypeForValue($obj->getActiveSheet()->getCellByColumnAndRow(1,0)->getValue()); //gets the data format from the excel file


Sep 8, 2009 at 1:23 PM

Ugg... That is not how dataTypeForValue() was meant to be used. It is mostly used internally in the library for determining what kind of data you are trying to insert via setValue().

What is it you are trying to do exactly?