Getting date() error from testdrive/protected/views/layouts/main.php(47)

Linux Mint7 Apache2 Php 5 Mysql. Made the Mysql changes but am getting an error:

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 ‘America/New_York’ for ‘EDT/-4.0/DST’ instead


Put this in your index.php:


This error occurs as of PHP 5.3.0.

Thanks, I found it missing from my php.ini file and fixed it but I’ll remember that about the index.php file.

such as mine, I just put this in my index.php file.


Cause I’m in China, and i has been changed my XAMPP for mac os x version. I using XAMPP 1.01, the PHP version is 5.2.9

Thanks #2’s friend.

I had the same problem with CentOS and PHP 5.3.2. So thanks.

You can also change the php.ini .

Find it (in CentOS /etc/php.ini), and inside you will see

;date.timezone =

replace it with (Athens is mine, use yours)

date.timezone = "Europe/Athens"

and restart Apache