After installing a php application my site loads the app with a warning overlayed on the page

Warning: strftime() [function.strftime]: 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.

I believe the problem is that there is no timezone set in php.ini on this server. My server company doesn't think that this is something they should have configured when they set up the server, so how do I edit the php.ini file and what do I insert to get rid of this error.

link|improve this question

feedback

2 Answers

up vote 3 down vote accepted

Not sure about editing the php.ini file, but I always set the default time zone as part of a config include

<?php date_default_timezone_set('Europe/London'); ?>
link|improve this answer
That did the trick. Thanks – Drai Oct 31 '11 at 14:39
feedback

If you want to do the fix the problem in the php.ini, you can use date.timezone like:

date.timezone = "THETIMEZONE"

If you want to do in the php script, you can use the date_default_timezone_set function:

date_default_timezone_set("THETIMEZONE");

Here you can find the list of the Timezone: http://www.php.net/manual/en/timezones.php

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.