Attention
TYPO3 v11 has reached end-of-life as of October 31th 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v10 here: TYPO3 ELTS.
dbType
dbType
-
- Type
- string
- Path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']
- Scope
- Proc.
If set, the date or time will not be stored as timestamp, but as native
date
,time
ordatetime
field in the database. Keep in mind that no timezone conversion will happen.
Examples
Date and time picker stored in a datetime field
CREATE TABLE tx_example_domain_model_foo (
synced_at datetime default NULL
)
Copied!
'synced_at' => [
'config' => [
'type' => 'input',
'renderType' => 'inputDateTime',
'dbType' => 'datetime',
'eval' => 'datetime,null',
],
],
Copied!
Time picker stored in a datetime field
CREATE TABLE tx_example_domain_model_foo (
synced_at time default NULL
)
Copied!
'synced_at' => [
'config' => [
'type' => 'input',
'dbType' => 'time',
'eval' => 'time,null',
],
],
Copied!
Note
When this property is not set you have to add int
to the eval option.
(Otherwise the database might complain about invalid values.)