format_date: include timezone in IntlDateFormatter object
@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.
This commit is contained in:
parent
6b76ce6f62
commit
dafd3f081a
1 changed files with 1 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue