Web Design Forum  
 
Go Back   Web Design Forum > Web Software > Programming

Like Tree1Likes
  • 1 Post By DHDdirect

Reply
 
LinkBack Thread Tools Display Modes
Old 10-06-2011, 12:29 AM   #1
Silver Member
 
Join Date: Jul 2011
Posts: 163
Question PHP & RSS Date Weirdness!

I have a PHP generating an RSS feed for my blog. I recently moved servers and the servers posts the date differently and firefox doesn't seem to like the newer dates as it doesnt show them up in my RSS feed. Other browsers dont seem to have a problem however.

Take a look here:
http://www.skepticize.me/subscribe/rss.php

So the new server shows things like (which firefox doesn't like):
<pubDate>Sun, 02 Oct 11 20:01:36 -0400</pubDate>

Old sever shows things like (which works fine):
<pubDate>Sat, 04 Jun 2011 14:22:27 MDT</pubDate>

This is the PHP code I have which generates and saves dates:
$blogdate = date(DATE_RFC822);

It seems the new server is giving -0400 which firefox doesn't like. Any suggestions on fixing this? Keep in mind I'm somewhat of a PHP newbie.
__________________
http://www.skepticize.me
Absolution is offline   Reply With Quote


Old 10-06-2011, 10:15 PM   #2
Bronze Member
 
n1c0_ds's Avatar
 
Join Date: Nov 2009
Location: Granby, Québec
Posts: 55
Send a message via Skype™ to n1c0_ds
Default

Perhaps it has to do with a parameter in your PHP.ini file? Otherwise, you can format your date() function manually in a way Firefox likes.

I think you might have a problem with firefox, though, because my site uses the +0000 format and Firefox has no problem with it (FF7)
__________________
Nicolas Bouliane
Web designer/developer in Granby, Québec
n1c0_ds is offline   Reply With Quote
Old 10-06-2011, 10:31 PM   #3
Silver Member
 
Join Date: Jul 2011
Posts: 163
Default

Quote:
Originally Posted by n1c0_ds View Post
Perhaps it has to do with a parameter in your PHP.ini file? Otherwise, you can format your date() function manually in a way Firefox likes.

I think you might have a problem with firefox, though, because my site uses the +0000 format and Firefox has no problem with it (FF7)
I will need to check it on other computers! If you could take a screen shot for me it would be great.
__________________
http://www.skepticize.me
Absolution is offline   Reply With Quote
Old 10-07-2011, 06:51 PM   #4
Silver Member
 
Join Date: Jul 2011
Posts: 163
Default

Update! I tried it on another firefox browser and computer. The RSS still opens and shows all the entries but it won't show the newer dates with the -0400. Weird!
__________________
http://www.skepticize.me
Absolution is offline   Reply With Quote
Old 10-25-2011, 08:30 PM   #5
Silver Member
 
Join Date: Jul 2011
Posts: 163
Default

Anyone have any other suggestions for this Firefox quirk? If all else fails, maybe I can contact the firefox team about this?
__________________
http://www.skepticize.me
Absolution is offline   Reply With Quote


Old 10-25-2011, 08:46 PM   #6
Gold Member
 
Join Date: Feb 2011
Location: Australia
Posts: 369
Default

If you set the default timezone in PHP does that help the issue?

Code:
date_default_timezone_set('MDT');
Absolution likes this.
__________________
Jason H.
DHDdirect.com
Domains - Hosting - Design
DHDdirect is offline   Reply With Quote
Old 10-27-2011, 06:31 PM   #7
Silver Member
 
Join Date: Jul 2011
Posts: 163
Default

Thanks DHD! I think that is the solution!
__________________
http://www.skepticize.me
Absolution is offline   Reply With Quote
Reply

Tags
date, php, rss

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:57 PM.


Camera Forum - Computer Forum - Web Design Forum

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.