Strict php time zone

После миграции на PHP 5.3.0 посыпалось некоторое количество ошибок вида

SYSTEM WARNING: 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 ‘UTC’ for ‘GMT/0.0/no DST’ instead

Собственно они вызваны тем что по умолчанию отображаются ошибки уровня E_STRICT, что поидее должно подталкивать людей к исправлению ошибок, а не к игнорированию их. Ну раз так, то указанную ошибку нужно исправить указанием корректной таймзоны в php.ini (Документация: http://us2.php.net/manual/en/datetime.configuration.php#ini.date.timezone; Списки доступных зон: http://us2.php.net/manual/en/timezones.php). Меня устроил такой вариант:

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

[Date]
; Defines the default timezone used by the date functions
; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
date.timezone = Europe/Moscow

This entry was posted in Профессиональное and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">