ODS Reader should also use the new Method for date values

This commit is contained in:
MarkBaker 2022-02-26 15:07:20 +01:00
parent ef4029df63
commit 52071e9f4a
1 changed files with 1 additions and 16 deletions

View File

@ -2,7 +2,6 @@
namespace PhpOffice\PhpSpreadsheet\Reader;
use DateTime;
use DOMAttr;
use DOMDocument;
use DOMElement;
@ -478,21 +477,7 @@ class Ods extends BaseReader
case 'date':
$type = DataType::TYPE_NUMERIC;
$value = $cellData->getAttributeNS($officeNs, 'date-value');
$dateObj = new DateTime($value);
[$year, $month, $day, $hour, $minute, $second] = explode(
' ',
$dateObj->format('Y m d H i s')
);
$dataValue = Date::formattedPHPToExcel(
(int) $year,
(int) $month,
(int) $day,
(int) $hour,
(int) $minute,
(int) $second
);
$dataValue = Date::convertIsoDate($value);
if ($dataValue != floor($dataValue)) {
$formatting = NumberFormat::FORMAT_DATE_XLSX15