Epic #77562: Misbehaviors with datetime values and timezones
Extbase: Support \DateTimeInterface instead of \DateTime
Extbase supports conversion from and to \DateTime objects in several situations. But you cannot work with \DateTimeImmutable or other implementations of the \DateTimeInterface.
Extbase should support working with the interface instead of the concrete class.
Updated by Sebastian Michaelsen over 5 years ago
As far as I see this would affect the following things would need to be changed:
- Wrong: When loading a database record into a model object, the
\DateTimeobject even when the property is annotated as
- Wrong: When saving a model to the database the
\TYPO3\CMS\Extbase\Persistence\Generic\Backendresults in an exception because
\DateTimeImmutableto a timestamp.
- More or less right: The DateTimeConverter doesn't force
\DateTimebut performs duck typing (
is_callable(array($targetType, 'createFromFormat'))). But the override feature (
->overrideTimeIfSpecified()) forces the first paramter to be