0
votes

phpinfo() tells me that my timezone is properly set:

enter image description here

date_default_timezone_get() returns "Europe/Berlin". Since I'm on 5.4.35 this should return the ini option (see the manual).

Do I still need to set the timezone, as PHP's warning tells me?

Strict Standards: strtotime(): 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/Berlin' for 'CET/1.0/no DST' instead in /your/skript.php on line 249

1
What value do you have in your php.ini for date.timezone setting?Sundrique
date_default_timezone_get() returns "Europe/Berlin". Since I'm on 5.4.35 this should return the ini option.user1322720

1 Answers

1
votes

Yes, you should always set the timezone, even if it is set on the server. This is needed as your script may not always run on that server, and may throw errors if moved to a server with an unset timezone.

Generally a good option for timezones is UTC:

date_default_timezone_set('UTC')