Review 13.4 Merged

88901[BUGFIX] Apply server timezone to datetime properties in record API

Benjamin Franzke CR +2 V +2 Hard +218 −74 updated 04/02/25, 10:38

Commit message

DateTime objects initialized with an @-prefix are forced to use UTC in
PHP. Since we require all dates to be initialized in localtime, we must
not instantiate DateTime from timestamps directly (see also #98045).

Instead we do now apply the same algorithm as already used by FormEngine
to transform database values to `\DateTime` instances. The logic is
extracted into a general purpose `DateTimeFactory`
The factory is intended to be rolled out in all places where database
values are converted into `\DateTime` representation.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
  • Verified V +2 Done
    • Benjamin Franzke +2
    • core-ci +1 CI

Issues 2

Files 8

Review log 46

  1. Benjamin Franzke commented on patch set 1 04/02/25, 08:16

    Cherry Picked from branch main. The following files contain Git conflicts: * typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseRowDateTimeFields.php * typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseRowDateTimeFieldsTest.php * typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputDateCest.php
  2. core-ci voted on patch set 1 V -1 04/02/25, 08:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76847

  3. Benjamin Franzke uploaded patch set 2 V -1 04/02/25, 10:16

  4. core-ci voted on patch set 2 V +1 04/02/25, 10:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76859

  5. Benjamin Franzke commented on patch set 2 CR +2 V +2 04/02/25, 10:38

    This change is ready for review.
  6. Benjamin Franzke merged patch set 3 04/02/25, 10:38