Main > PHP > Настройка TimeZone для Украины

Настройка TimeZone для Украины

14.02.2012 0 comments » Views: 10,607

PHP

Стоит Denwer для локального тестинга. Получил ошибку:

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.

Так как под большую часть проектов использую свой набор классов, конфигов и сборок (mod_rewrite, smarty и т.д.) то в конфиги от этой беды давно прописан код:

который благополучно истреблял данную проблему, сейчас же решил попользовать Yii и получил эту же проблему:

PHP Error

Description
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 'Europe/Helsinki' for '3.0/DST' instead

Source File
...

Stack Trace
...

Warning: 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 'Europe/Helsinki' for '3.0/DST'...
2010-04-15 11:03:53 Apache/2.2.4 (Win32) mod_ssl/2.2.4 OpenSSL/0.9.8d PHP/5.3.1 Yii Framework/1.1.1

Разумеется править framework не стал, надо это исправить на верхнем уровне. Полез в php.ini и нашел там:

поправил на

и все заработало 🙂

Список timezon-ов тут: List of Supported Timezones

List of Supported Timezones

Author: | Rating: 4/5 | Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *

Allowed HTML-tags: <a>, <code>, <i>, <em>, <strong>, <b>, <u>, <strike>