#106453Record API does not respect server timezone for resolve datetime fields
Description
In a content preview element, registered via page tsconfig:
mod.web_layout {
tt_content {
preview {
textmedia = EXT:mysite/Resources/Private/Templates/Preview/Textmedia.html
}
}
}
and PHP timezone set to Europe/Berlin
$GLOBALS['TYPO3_CONF_VARS']['SYS']['phpTimeZone'] = 'Europe/Berlin';
The resolved record will be initialized as UTC DateTime object instead of Europe/Berlin:
<f:debug>{record.date}</f:debug>
For a date “2025-03 29” entered in “header date” field, the output will be
Output:
DateTimeImmutable prototype object (2025-03-28T23:00:00+00:00, 1743202800)
Expected Output:
DateTimeImmutable prototype object (2025-03-29T00:00:00+01:00, 1743202800)
Reviews 6
- 13.4 89060[BUGFIX] Fix possible PHP type error in DateTimeFactory
- main 89056[BUGFIX] Fix possible PHP type error in DateTimeFactory
- 13.4 88944[BUGFIX] Use DateTimeFactory for database datetime value interpretation
- main 88826[BUGFIX] Use DateTimeFactory for database datetime value interpretation
- 13.4 88901[BUGFIX] Apply server timezone to datetime properties in record API
- main 88823[BUGFIX] Apply server timezone to datetime properties in record API