I´m trying to update an old simple extension, which has a date-field (type "date" in database). Dates are saved like "2024-09-05" in the database.
In the fluid template, i have something like:
<f:format.date format="d.m.Y">{foo.startdate}</f:format.date>
I works fine (output like 05.09.2024) in TYPO3 11, but in TYPO3 12 outout is 01.01.1970 for all dates.
Has anyone an idea what to do? Thanks!
That solves my problem:
like that:
'startdate' => [
'exclude' => true,
'label' => 'LLL:EXT:myextension/Resources/Private/Language/locallang_db.xlf:myextension.startdate',
'config' => [
'type' => 'datetime',
'default' => 0,
'behaviour' => [
'allowLanguageSynchronization' => true,
],
],
],
You can use "Select UNIX_TIMESTAMP(startdate), uid FROM mytable;" to get the timestamp values, than use that data to update the values: "Update mytable SET startdate=1529186411 WHERE uid =123;". There might be a better way to do that!