From 0c3a5c2e4076f9529b478133b03f1de8ea87eea3 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sun, 6 Mar 2016 23:27:33 +0000 Subject: [PATCH] Allow formatted strings as argument in PHPToExcel date conversion --- src/PhpSpreadsheet/Shared/Date.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PhpSpreadsheet/Shared/Date.php b/src/PhpSpreadsheet/Shared/Date.php index 3b193a95..faccfbdd 100644 --- a/src/PhpSpreadsheet/Shared/Date.php +++ b/src/PhpSpreadsheet/Shared/Date.php @@ -189,6 +189,8 @@ class Date $retValue = self::FormattedPHPToExcel($dateValue->format('Y'), $dateValue->format('m'), $dateValue->format('d'), $dateValue->format('H'), $dateValue->format('i'), $dateValue->format('s')); } elseif (is_numeric($dateValue)) { $retValue = self::FormattedPHPToExcel(date('Y', $dateValue), date('m', $dateValue), date('d', $dateValue), date('H', $dateValue), date('i', $dateValue), date('s', $dateValue)); + } elseif (is_string($dateValue)) { + $retValue = self::stringToExcel($dateValue) } date_default_timezone_set($saveTimeZone);