PHP5 date() Function

php-logo

Whilst migrating a clients website to a new server today I came across an unexpected error:

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. (etc)

Well, if you are on shared hosting you most likely do not have access to the php.ini file in order to set the timezone.
Instead head along to your .htaccess file and add the folllowing line:
php_value date.timezone [your_zone] where [your_zone] is found from the link here

Leave a Comment

Your email address will not be published. Required fields are marked *