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

History 39

  1. Benjamin Franzke commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-04-02T10:40:08+00:00" > 04/02/25, 10:40 </span>

    Applied in changeset commit:6ab7296ec3e0cfae1e3779d8d3c6185efb07d822.