A
A
Alexander Smirnov2020-09-29 19:37:20
Laravel
Alexander Smirnov, 2020-09-29 19:37:20

Unknown or bad timezone (Europe/Moscow) - how is this possible?

We have Laravel with timezone settings

'timezone' => 'UTC',  // настройка для самого Laravel
'api_timezone' => 'Europe/Moscow', // настройка для данных от API


Next, we have the processing of incoming data, including date parsing by Carbon
$income_date = Carbon::
    createFromFormat(
        'Y-m-d\TH:i:s', 
        $record['date'], 
        config('app.api_timezone')
    )->
    setTimezone(config('app.timezone'))->
    toDateTimestring();


And this is where the fun begins. On the local machine, everything works as expected, and specifically the dates received are shifted 3 hours ago. Today deployed on Ubuntu 18.04, swears at the time zone. Already 10 times I copied the name of the time zone from the documentation, updated and reloaded php, the problem remains. The php version is the same on localhost and on VDS - 7.3

I would be grateful for any help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Grechushnikov, 2020-10-06
@maxyc_webber

dpkg-reconfigure tzdata

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question