Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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.

share|improve this question
add comment

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'); ?>
share|improve this answer
    
That did the trick. Thanks –  Drai Oct 31 '11 at 14:39
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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