#109195Timezone in f:format.date Viewhelper isn't respected when using pattern
Description
Calling the ViewHelper with a defined timezone and format works correctly.
However, when using pattern instead of format, the formatting does not work as expected. In this case, the date string is always formatted using the PHP default timezone.
*The issue*
In TYPO3\CMS\Core\Localization\DateFormatter , within the format method, the IntlDateFormatter is instantiated without passing the timezone of the date object. As a result, the timezone information from the date object is lost during the formatting process.
*Example fix*
When creating the IntlDateFormatter, the timezone from the date object should be passed explicitly:
@new \IntlDateFormatter($locale, \IntlDateFormatter::FULL, \IntlDateFormatter::FULL, $date->getTimezone(), …);@
This ensures that the formatter uses the correct timezone associated with the date object.
Reviews 1
History 13
-
Garvin Hicking commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2026-03-09T20:55:23+00:00" > 03/09/26, 20:55 </span> -
Gerrit Code Review pushed patch set 1 for main to change 95136 status
Needs FeedbackUnder Review <span data-processor="relativetime" data-value="2026-08-06T19:38:07+00:00" > 08/06/26, 19:38 </span> -
Gerrit Code Review pushed patch set 2 for main to change 95136 <span data-processor="relativetime" data-value="2026-08-06T19:40:24+00:00" > 08/06/26, 19:40 </span>
Hi Julian!
That sounds like a plausible discovery. Would you maybe like to contribute a patch? I can help to guide you if you need help for it.
Thanks,
Garvin