feed2js icon indicating copy to clipboard operation
feed2js copied to clipboard

Warning: date(): It is not safe to rely on the system's timezone settings.

Open rocpic opened this issue 12 years ago • 4 comments

Hello, about 3 days ago, the news feeds on http://RocPic.Com/news stopped showing. I viewed the source code

which is 15 instances of the first paragraph below, followed by the 2nd paragraph, then the missing news stories are below that.

Warning: date(): 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 'America/New_York' for 'EDT/-4.0/DST' instead in /home/feed2js/domains/feed2js.org/public_html/feed2js.php on line 306

Warning: Cannot modify header information - headers already sent by (output started at /home/feed2js/domains/feed2js.org/public_html/feed2js.php:306) in /home/feed2js/domains/feed2js.org/public_html/feed2js.php on line 387 feed2js_ck = true;

.... document.write('

'); document.write('

rocpic avatar Jun 27 '13 12:06 rocpic

So I went back to http://feed2js.org and pasted in the RSS feed from google, and if you include the date and time setting your preview will come up blank. I'm going to edit it out of my pages for now.

rocpic avatar Jun 28 '13 05:06 rocpic

I moved the old index to http://rocpic.com/news/dateindex.html the http://rocpic.com/news works without dates.

rocpic avatar Jun 28 '13 05:06 rocpic

I can confirm this is happening when you enter an offset value for the time zone. if you leave it as the default value you get the dates. I am testing some things, first will be suppressing error warnings in the output (that should be off). There is a date_default_timezone_set() declared in the setup functions, not quite sure why this is tripping that message.

cogdog avatar Jun 28 '13 05:06 cogdog

Is there a specific feed or configuration value that causes this error to occur? If I can pinpoint what throws the error I can fix it.

date_default_timezone_set should be the preferred method to set a timezone. Although we might want to sterilize that input first (to make sure invalid values aren't sent).

Another option would be to set the date via ini_set('date.timezone')

My apologies if this has already been taken care of... I just came across this issue when browsing the feed2js development tree to make sure I had www.feed2js.org up to date.

Thanks, Brian

bateller avatar Jul 22 '13 15:07 bateller