Issue Bug Closed

#106453Record API does not respect server timezone for resolve datetime fields

Benjamin Franzke 03/28/25, 15:22 updated 12/02/25, 14:21

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