Automatic timezone update to BST

Is there a way of automatically changing UTC → BST when applicable within the application? I’ve noticed that all my schedulers are now an hour late after the time change, but if I adjust this manually they’ll be executed an hour too early in half a year.
Is there any recommended way of handling the time change process?

timezone can be change in config/app.php Ex:

<?php

return [

     ...

    'timezone' => 'America/New_York',

];

Heya!

Thank you for the quick answer. I know it can be changed (from what I’ve seen you shouldn’t edit config/app.php, but config/backend.php as well as config/cms.php instead).

The question is, however, how to handle automatic time change from Winter to Summer and vice versa.

When do the clocks change? - GOV.UK.

Thank you for the quick answer. I know it can be changed (from what I’ve seen you shouldn’t edit config/app.php, but config/backend.php as well as config/cms.php instead).

Can you explain why?

EDIT: maybe that’s why. You don’t want your records db timestamp to be subject to a timezone hour change.

The question is, however, how to handle automatic time change from Winter to Summer and vice versa.

New York is using Eastern Daylight Time and Eastern Standard Time.

‘timezone’ => ‘America/New_York’ will adjust automatically

EDIT: maybe that’s why. You don’t want your records db timestamp to be subject to a timezone hour change.

To my understanding it will ensure database consistency whilst ‘translating’ the timestamps indeed!

New York is using Eastern Daylight Time and Eastern Standard Time.
‘timezone’ => ‘America/New_York’ will adjust automatically

Ahh it makes sense! Thank you for this!

Small update for the people who might’ve ended up there

Kernel has the following function

protected function scheduleTimezone()
    {
        $config = $this->app['config'];

        return $config->get('app.schedule_timezone', $config->get('app.timezone'));
    }

which means it looks at config/app.php

Editing config/backend.php and config/cms.php is not enough.

I dont recommended to change default timezone for whole app because it will get out of sync if server, db and website runs on different timezones.

Best solution is like @Marcino pointed out there is config or specic setup in scheduler.

1 Like