Mobile app version of vmapp.org
Login or Join
Gretchen104

: 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

@Gretchen104

Posted in: #Php

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.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Gretchen104

2 Comments

Sorted by latest first Latest Oldest Best

 

@Jessie594

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'); ?>

10% popularity Vote Up Vote Down


 

@BetL925

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme