Warning Message

Hello friends

I create a new project on Yii when I go to test on browser I get this message:

PHP warning

date() [<a href=‘function.date’>function.date</a>]: 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 ‘America/Sao_Paulo’ for ‘BRST/-2.0/DST’ instead

How can I fix this warning?

I use php 5.3.17 and apache 2.

You can use either date_default_timezone_set in your index.php or date.timezone in your php.ini.

You will want to use "America/Sao_Paulo" as the parameter.

Thank you

Hi Alexandre

Do you have the same problem when use date’s function in pure php code? (without Yii framework)

If the problem exist in other cases, upgrade your system and examine the parameters of time and date zone