: Fix PHP Timezone warning 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
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.
More posts by @Gretchen104
2 Comments
Sorted by latest first Latest Oldest Best
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'); ?>
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: www.php.net/manual/en/timezones.php
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.