Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"It is not safe to rely on the system's timezone settings"

Tags:

timezone

php

I have a script that I completed a week ago, without any problem or bug. Today, I tested it again and I received these messages:

Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable 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/London' for '1.0/DST' instead in C:\Users\xx\VertrigoServ\www\login\PHPMailer\class.phpmailer.php on line 1925

Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable 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/London' for '1.0/DST' instead in C:\Users\xx\VertrigoServ\www\login\PHPMailer\class.phpmailer.php on line 1929

I already set in the php.ini ;date.timezone = "Europe/Lisbon" and the same occurs. I've already restart the server

Any ideas?

like image 709
daniel__ Avatar asked Apr 17 '11 22:04

daniel__


2 Answers

In php.ini, ; comments out a line, so ;date.timezone = "Europe/Lisbon" does nothing. Uncomment that line by removing that preceding ; and restart Apache.

like image 64
Jimmy Sawczuk Avatar answered Oct 21 '22 20:10

Jimmy Sawczuk


Why not do the following:?

date_default_timezone_set('Europe/Lisbon');
like image 24
Christian Avatar answered Oct 21 '22 19:10

Christian