1292 Incorrect datetime value:
1292 Incorrect datetime value:
mmurangwa
Posts: 2Questions: 1Answers: 0
Good Day
Am trying to save a date value to a MySQL database and am getting the error below.
SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2017-01-26T16:15:27+02:00' for column 'create_date' at row 1
the code setting the date value is
->on('preCreate', function ( $editor, $values ) {
$editor
->field('members.creator_id')
->setValue($_SESSION['user_id']);
$editor
->field('members.create_date')
->setValue(date('c'))
->getFormatter( 'Format::date_sql_to_format', 'Y-m-d H:i:s' );
})
@GLOBAL.sql_mode is set to
STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION
and it can not be changed.
@GLOBAL.sql_mode setting.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I think you probably want to use:
Allan
Worked thanks Allan