From 802a94fc5da3573cec3774579b1538496a59c52a Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sun, 6 Mar 2016 23:25:13 +0000 Subject: [PATCH] Allow formatted strings as argument in PHPToExcel date conversion --- Classes/PHPExcel/Shared/Date.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Classes/PHPExcel/Shared/Date.php b/Classes/PHPExcel/Shared/Date.php index a0a4e39..025a6ec 100644 --- a/Classes/PHPExcel/Shared/Date.php +++ b/Classes/PHPExcel/Shared/Date.php @@ -187,7 +187,8 @@ class PHPExcel_Shared_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); return $retValue;