From 432e5845e1c016699a847bcbc3e8106b1872c75f Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Wed, 6 Mar 2019 22:25:00 +0100 Subject: [PATCH] isDateTime() now checks for cell value as well as format mask (#919) * isDateTime() now checks for cell value as well as format mask --- src/PhpSpreadsheet/Shared/Date.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/PhpSpreadsheet/Shared/Date.php b/src/PhpSpreadsheet/Shared/Date.php index 91c3ee0e..11293136 100644 --- a/src/PhpSpreadsheet/Shared/Date.php +++ b/src/PhpSpreadsheet/Shared/Date.php @@ -325,11 +325,12 @@ class Date */ public static function isDateTime(Cell $pCell) { - return self::isDateTimeFormat( - $pCell->getWorksheet()->getStyle( - $pCell->getCoordinate() - )->getNumberFormat() - ); + return is_numeric($pCell->getValue()) && + self::isDateTimeFormat( + $pCell->getWorksheet()->getStyle( + $pCell->getCoordinate() + )->getNumberFormat() + ); } /**