#106937TCA Datetime with different outputs depending on the “readonly” status
Description
If you create a datetime entry in the TCA, you get different outputs depending on whether readonly = true or not.
If readonly is true the element render the date with php and add the timezone to the output.(in my case UTC+2)
If readonly is false, the element will display the date in a data attribute that contains the timestamp UTC+0.
Test TCA:
[
'exclude' => true,
'label' => Test',
'config' => [
'type' => 'datetime',
'default' => null,
'size' => 30,
'readOnly' => true,
'dbType' => 'datetime',
'nullable' => true,
],
],
'readOnly' => true, => 19:40 'readOnly' => false => 17:40
Reviews 3
Related issues 1
History 58
-
Benjamin Franzke commented and changed status
NewAccepted <span data-processor="relativetime" data-value="2025-06-23T20:17:09+00:00" > 06/23/25, 20:17 </span> -
Benjamin Franzke changed Related to #105549 <span data-processor="relativetime" data-value="2025-06-23T20:17:15+00:00" > 06/23/25, 20:17 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 89814 status
AcceptedUnder Review <span data-processor="relativetime" data-value="2025-06-23T20:31:04+00:00" > 06/23/25, 20:31 </span> -
Thomas Rokohl commented <span data-processor="relativetime" data-value="2025-06-24T05:50:42+00:00" > 06/24/25, 05:50 </span>
The patch works and solves the problem.
Thank you.
-
Gerrit Code Review pushed patch set 1 for 12.4 to change 89867 <span data-processor="relativetime" data-value="2025-06-25T09:45:06+00:00" > 06/25/25, 09:45 </span>
-
Gerrit Code Review pushed patch set 2 for 13.4 to change 89814 <span data-processor="relativetime" data-value="2025-06-25T10:34:22+00:00" > 06/25/25, 10:34 </span>
-
Benjamin Franzke commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2025-07-02T10:40:10+00:00" > 07/02/25, 10:40 </span>Applied in changeset commit:9675b92fd56fbc20cea0df146cb70a1022333d82.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-12-02T14:27:42+00:00" > 12/02/25, 14:27 </span>
Ack, confirm that this is still broken in TYPO3 v13.
Note: TYPO3 main/v14 fixed this via https://review.typo3.org/c/Packages/TYPO3.CMS/+/86888
(but) we need a fix for v13, because the readonly handling passes the fake UTC-0 string into the
DateTimeconstructor, interpreting it as real UTC_0 instead of as fake UTC-0 (therefore local timezone offset is clamped).Relevant code is:
https://github.com/TYPO3/typo3/blob/v13.4.14/typo3/sysext/backend/Classes/Form/Element/DatetimeElement.php#L109