Read Date as String

Topics: Developer Forum, Project Management Forum, User Forum
May 16, 2011 at 11:20 PM


I've some problems by reading the following cell-value 11.01.1900 as String value by using such method like PHPExcel_Style_NumberFormat::toFormattedString($cell->getCalculatedValue());

I get always the number 12.

Does someone has any idea how to read such values as a string???



May 17, 2011 at 2:14 PM

I do it like this:

$date = PHPExcel_Style_NumberFormat::toFormattedString($data, "M/D/YYYY");

May 17, 2011 at 2:27 PM
Edited May 17, 2011 at 2:28 PM

Hi Scott,

thank you for your help, but what about if do not expect a date format in the cell??? In my use case sometimes can be found values which have date format and some times only some characters and I need both values.

What I saw today, was that in WinXP Environment  I didn't had problems with this but in Windows 7 yes!!!!