D
D
Daniil Sidorov2018-12-11 10:31:25
PHP
Daniil Sidorov, 2018-12-11 10:31:25

Why is the time on the server and when executing cron tasks different?

Good afternoon. The time zone Europe/Moscow is set on the server and everything works correctly.
But in cron tasks, the time differs from Moscow by -3 hours. The commands are called as follows:
/opt/php/7.1/bin/php /var/www/...
I went to the server via SSH, wrote the date command and got the Moscow time. Tell me how to fix it. Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrew, 2018-12-11
@R0dger

php.ini look - there
date.timezone = Europe/Moscow

V
vman, 2018-12-11
@vman

For starters, just try to restart Cron, if the TZ settings are done, but Cron has not been restarted, then it works with the old zone.
Make sure /etc/localtime is looking at the correct TZ

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question