I have people table and in this I have a field named birthday as timestamp.
When i insert date data like: 2017-05-19
its ok and no errors but when i want to insert some old dates like 1959-08-12
its says:
Invalid datetime format: 1292 Incorrect datetime value: '1959-08-12' for column 'birthday' at row 1
I am inserting the date like this:
Person::create([
...
'birthday' => date('Y-m-d' , strtotime($birthday)),
...
])
Also i try this question/answer and remove the NO_ZERO_IN_DATE,NO_ZERO_DATE
from sql_mode
variable, but not working for me.
MySQL: 5.7.23 PHP: 7.2 Laravel: 6.5