Feature #72053
closed
Epic #77562: Misbehaviors with datetime values and timezones
Extbase: Support \DateTimeInterface instead of \DateTime
Added by Sebastian Michaelsen over 8 years ago.
Updated over 5 years ago.
Description
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.
- Target version set to 8 LTS
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
DataMapper
creates a \DateTime
object even when the property is annotated as \DateTimeImmutable
.
- Wrong: When saving a model to the database the
\TYPO3\CMS\Extbase\Persistence\Generic\Backend
results in an exception because ->getPlainValue()
doesn't convert \DateTimeImmutable
to a timestamp.
- More or less right: The DateTimeConverter doesn't force
\DateTime
but performs duck typing (is_callable(array($targetType, 'createFromFormat'))
). But the override feature (->overrideTimeIfSpecified()
) forces the first paramter to be \DateTime
.
- Target version changed from 8 LTS to 9.0
- Related to Epic #80852: Datetime handling in backend added
- Parent task set to #77562
- Related to deleted (Epic #80852: Datetime handling in backend)
- Target version deleted (
9.0)
- Status changed from New to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
- Related to Bug #73637: Extbase DateTimeConverter cannot handle negative timestamps added
- Related to Bug #90992: Fix programming error that only works for subtle reasons added
Also available in: Atom
PDF