Joseph Batson
Joseph Batson

Reputation: 45

PHPExcel not reading user defined date formats

Trying to parse excel sheets but running into issues with user-defined date formats. The date format does not get added to the formattedData. I have no way of knowing what cell is going to contain a date and the dates come in all types of formats.

Example: M/D/YYYY - 11/17/2015

After parsing the sheet I get the floating point date with no format. I did not echo out the format from PHPExcel on this one.

In another case I echoed out the get format data and it was General for the column column that contained the date, but in excel it had a valid date format albeit user defined of D-MMM-YY - 15-Jul-14.

Testing for dates in these scenarios did not work either using,

PHPExcel_Shared_Date::isDateTime($cell);

So to the question, how do I get the date format or test if it is a date when the format is user defined?

Upvotes: 1

Views: 198

Answers (1)

Joseph Batson
Joseph Batson

Reputation: 45

Same issue as PHPExcel number formats for dates

It is using built-in number format id's for custom date formats.

Upvotes: 1

Related Questions