-
get all data from worksheet as ..... ->toArray(null, true, true, true); Cell in xls file "01.03.2023 10:57:06" get in ->toArray(null, true, true, true); "44986.456319444" How to fix it ? O |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
This should work: what version of PhpSpreadsheet are you using? Or are you loading a file and telling the Reader to read Data Only? |
Beta Was this translation helpful? Give feedback.
-
You do realise that The value that looks like |
Beta Was this translation helpful? Give feedback.
You do realise that
$reader->setReadDataOnly(true);
is telling the Reader to load only the raw data from the worksheet, and not to load the formatting information for cells?The value that looks like
01.03.2023 10:57:06
in the Excel cell is an Excel serialized timestamp, a numeric value (44986.456319444
) with a number format mask that tells Excel to display it like a date.When you do
$reader->setReadDataOnly(true);
, you're telling PhpSpreadsheet to load the value (44986.456319444
), but not to load the number format mask.See the documentation here