I am facing issues with dates and time. I want them to be read just like they appear in the excel workbook.
So, I believe if I get all cells of the sheet using toArray(), then I should simply do something (some format conversion) that will map all cells as strings, dates, times etc.
OR may be there is function like load, which load all data in the workbook as string without any formating or other complex stuff.
toArray() supports the following arguments:
/**
* @param mixed $nullValue Value returned in the array entry if a cell doesn't
* exist
* @param boolean $calculateFormulas Should formulas be calculated?
* @param boolean $formatData Should formatting be applied to cell values?
* @param boolean $returnCellRef False - Return a simple array of rows and
* columns indexed by number counting from zero
* True - Return rows and columns indexed by their
* actual row and column IDs
*/
so
toArray(NULL,TRUE,TRUE);
will return all the cell values in the worksheet (calculated and formatted) exactly as they appear in Excel itself.
So dates will be returned as (for example) 21-Dec-2011 07:30 rather than 47239.318 (depending on the format mask for the cell). Other numeric cells could be returned as 21,357.00 (depending on the format masking for that cell) so it is a two-edged sword.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With