Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BUG REPORT It is not safe to rely on the system's timezone settings.
#1
Warning: strtotime(): 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. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /plugins/news_manager/inc/functions.php on line 18

Showing loads of error messages on my site please anyone?


Code:
/*******************************************************
* @function nm_get_posts
* @param $all if true, include private and future posts
* @return array with posts
*/
function nm_get_posts($all=false) {
 $now = time();
 $posts = array();
 $data = @getXML(NMPOSTCACHE);
 foreach ($data->item as $item) {
   if ($all || $item->private != 'Y' && strtotime($item->date) < $now)   <~~~Line 18
     $posts[] = $item;
 }
 return $posts;
}
Pete

Chefbyte Services
Reply
#2
site address is www.peteberry.co.uk
Pete

Chefbyte Services
Reply
#3
It's plugin related right? (News Manager)
Maybe post it in it's specific forum.
Reply
#4
I had this error message thrown from my local development server
The solution was to open php.ini and search for "data.timezone"
Uncomment data.timezone
and example set it to this: data.timezone = "Europe/London"

change "Europe/London" to your local time zone

=========================================================

Go to your hosting CPanel and see if you can edit php.ini
and check if data.timezone is configured

If your CPanel does not give you the option to edit php.ini
then create your own php.ini and upload it to the root
of your website.

See if that helps
Reply
#5
If your application runs on an Apache and you are not able to access the php.ini file, you can also use date_default_timezone_set('Europe/London') php function. It sets the default timezone used by all date functions in your script.

Note, it has to be called before calling the date/time functions.
Reply
#6
@chefbyte, did you select a local timezone in your GS settings?
Reply
#7
(2019-10-15, 23:08:27)Carlos Wrote: @chefbyte, did you select a local timezone in your GS settings?

I did indeed set it as it was the first place I looked to see if it was correct Smile
Pete

Chefbyte Services
Reply
#8
Try setting the timezone in gsconfig.php, like:
Code:
define('GSTIMEZONE', 'Europe/London');
or
Code:
define('GSTIMEZONE', 'UTC');

I think that you have to set Local timezone to --None-- in GS settings, so that this works.
Reply
#9
Anyway, I suspect you have an old version of the News Manager plugin. (Not sure if it's related to your issue, but I suggest you upgrade just in case.)
Reply




Users browsing this thread: 1 Guest(s)