Ошибка PHP — function.date function.strtotime

После обновления MySQL, а соответственно всего что связанно с ним повылезали ошибки.
Проявились они немного позже, поэтому пришлось поломать голову от куда он взялись.


ОШИБКИ на сайте по управлением joomla:

Warning: strtotime() [function.strtotime]: It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Novosibirsk’ for ‘NOVT/6.0/no DST’ instead in /var/www/html/libraries/joomla/utilities/date.php on line 56

Warning: strftime() [function.strftime]: It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Novosibirsk’ for ‘NOVT/6.0/no DST’ instead in /var/www/html/libraries/joomla/utilities/date.php on line 250

ОШИБКИ на форуме по управлением phpBB:

[phpBB Debug] PHP Notice: in file /index.php on line 86: date() [function.date]: It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Novosibirsk’ for ‘NOVT/6.0/no DST’ instead
[phpBB Debug] PHP Notice: in file /index.php on line 86: getdate() [function.getdate]: It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Novosibirsk’ for ‘NOVT/6.0/no DST’ instead
[phpBB Debug] PHP Notice: in file /includes/functions_announcements.php on line 75: date() [function.date]: It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Novosibirsk’ for ‘NOVT/6.0/no DST’ instead
[phpBB Debug] PHP Notice: in file /includes/functions_announcements.php on line 75: getdate() [function.getdate]: It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Novosibirsk’ for ‘NOVT/6.0/no DST’ instead

Решение проблемы

Необходимо отредактировать временную зону в php.ini.
В php.ini правим date.timezone. В моём случае эта строка выглядела так:

;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;

[Date]
; Defines the default timezone used by the date functions
date.timezone = Asia/Novosibirsk
Share

You may also like...

3 комментария

  1. А как быть если отдельно взятый сайт должен работать в другой временной зоне?

Добавить комментарий

Ваш адрес email не будет опубликован.