php 5.3, time and date functions and timezone

After installing PHP 5.3, you may get a warning for every function involving date and time like

Warning: strtotime() [function.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/London' for [...]

To fix this, you can set the timezone in your script using date_default_timezone_set(‘Europe/London’); or set it into the php.ini file with date.timezone = ‘Europe/London’


comments powered by Disqus