Answer the question
In order to leave comments, you need to log in
Laravel 5.4 does not spell TIMESTAMP correctly. Why?
In php.ini date.timezone = Europe/Moscow;
$date->getTimestamp()
Shows correctly.
The server time is correct: Europe/Moscow
# dateSat Apr 22 19:03:15 MSK 2017
Checking the base time: SELECT CURRENT_TIMESTAMP;
Shows the correct one.
In Laravel app/config is - 'timezone' => 'Europe/Moscow',
I check in Laravel: Carbon\Carbon::now() Veronoe!
But if the queues work and an error occurs, then the failed_jobs table writes the date 3 hours earlier in the failed_at field . That is, for example, not 19:00 but 16:00
Why!??
Answer the question
In order to leave comments, you need to log in
They are executed through cli, cli has its own php.ini. Check the zone there. Just to get started, on the command line, runphp -r "echo date('H:i:s');"
Laravel writes the date in UTC format.
Write your date fields in the model, and then work with it through Carbon to your heart's content.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question