Project

General

Profile

Actions

Bug #94699

open

Extbase: DateTimeImmutables won't be stored as UTC

Added by Moritz Ngo over 3 years ago. Updated over 3 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2021-08-03
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

When using a \DateTimeImmutable property and TCA dbType is set to date, time or datetime then the actual value won't get persisted as UTC in the database.

After the value has been persisted, the value will be read from the database and interpreted as UTC, thus the model will have a wrong \DateTimeImmutable property value.

The issue is caused, by \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper::getPlainValue() where timezone will be set to UTC.
The \DateTimeImmutable won't be updated with the "new" timezone, thus a wrong value will be stored.

This issue occurs in the following TYPO3 CMS versions:

TYPO3 CMS v11 should not be affected, because the the timezone won't be altered.

Actions #1

Updated by Moritz Ngo over 3 years ago

  • Description updated (diff)
Actions #2

Updated by Moritz Ngo over 3 years ago

  • Description updated (diff)
Actions

Also available in: Atom PDF