What do you mean by incorrect timestamp? Can you show an example of what it suppose to be and what you are getting.
Dec 6, 2019
5
Level 4
Incorrect time in created_at
I have a table with timestamps column (created_at and updated_at) in mySql database. I am using laravel version 5.4 and php 7.0.
I happened to notice that it is adding incorrect time to this particular column.
How to set this column to set timestamp correct
Level 70
It's because of the default timezone of Database.
Go to app.php page in Config folder and change this
'timezone' => 'UTC',
to
'timezone' => 'Asia/Dhaka', // You need to adjust your timezone based on your location.
reference https://laravel.com/docs/6.x/configuration
find your timezone http://php.net/manual/en/timezones.php
2 likes
Please or to participate in this conversation.