From dafd3f081ab581e074f3280d4323dc92cb33df46 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 19 Jan 2021 15:03:28 +0100 Subject: format_date: include timezone in IntlDateFormatter object MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @see https://www.php.net/manual/en/intldateformatter.format.php > If a DateTime or an IntlCalendar object is passed, its timezone is not considered. The object will be formatted using the formaterʼs configured timezone. If one wants to use the timezone of the object to be formatted, IntlDateFormatter::setTimeZone() must be called before with the objectʼs timezone. --- application/Utils.php | 1 + 1 file changed, 1 insertion(+) (limited to 'application/Utils.php') diff --git a/application/Utils.php b/application/Utils.php index 952378ab..c5cd884b 100644 --- a/application/Utils.php +++ b/application/Utils.php @@ -323,6 +323,7 @@ function format_date($date, $time = true, $intl = true) IntlDateFormatter::LONG, $time ? IntlDateFormatter::LONG : IntlDateFormatter::NONE ); + $formatter->setTimeZone($date->getTimezone()); return $formatter->format($date); } -- cgit v1.2.3