homepage Welcome to WebmasterWorld Guest from 54.226.7.15
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
Forum Library, Charter, Moderators: bill & werty

RSS, ATOM, and Related Technologies Forum

    
Changing the way date and time are displayed
Can I change the way the date and time is displayed?
dnab




msg:4114178
 8:40 am on Apr 12, 2010 (gmt 0)

I am trying to work out how to change the way the time/date are displayed in my feed. I am dynamically creating the feed through PHP, and it works fine but I would like the pubDate to not have the time in it as it is irrelevant to the content. Some browsers seem to show the year and some don't, so it would also be nice to get that to display on all browsers (perhaps this is not possible?) I am pulling the data from a mySQL database in the following format (yyyy-mm-dd) and then converting it to RFC2822. If I manually strip out the last 15 chataracters the pubDate is reverting to current time. Is there a way to at the very least remove the time from the end of the pubDate displayed? In IE I seem to be getting the day of the week too (which is fine and what I would really like everywhere), while in Chrome I don't seem to be getting any date/time. Safari and Firefox also do not display how I would like it. Perhaps this (as mentioned above) is browser related and there is nothing I can do about it? I have run the xml through an rss validator and it is happy with it. Thanks for any help in advance.

 

bill




msg:4114182
 8:53 am on Apr 12, 2010 (gmt 0)

Welcome to WebmasterWorld dnab.

I'm afraid your feed will not validate if you don't give it the proper format for pubDate. All date-times in RSS conform to the Date and Time Specification of RFC 822 [asg.web.cmu.edu].

I wouldn't be concerned what shows up in various aggregators or viewers if the feed conformed to the standard and was valid. You can't control how others interpret the standard, but you can generally be safe by following it yourself.

dnab




msg:4114185
 9:08 am on Apr 12, 2010 (gmt 0)

Thanks for the very quick response. Since I can't remove the time I have set it manually to 18:00 however although Safari seems to display the time as 6:00 PM, IE is displaying the time as 7:00:00 PM. I appreciate I can't control how the timestamp/pubDate is displayed but I am somewhat still confused! When I do a view code in IE the pub date reads as in the format of the following example: Thu, 26 Nov 2009 18:00 +0000

Is this a GMT/BST thing? I guess there isn't a way to fix that either and I have answered my own question? What would happen if an RSS feed needed to be accurate in the way the time was displayed? Thanks again for your help.

bill




msg:4114735
 1:56 am on Apr 13, 2010 (gmt 0)

It sounds like IE is accessing your system settings and adjusting for daylight savings (Summer) time. Just make sure that you are using the proper UTC time with your pubDate and then you should be safe.

g1smd




msg:4114784
 3:42 am on Apr 13, 2010 (gmt 0)

Why the heck are newer protocols still using RFC 822?

RFC 3339 has been around for more than a decade and solves many issues (though probably not this one).

bill




msg:4114788
 3:56 am on Apr 13, 2010 (gmt 0)

Atom uses RFC 3339, but RSS 2 is still using RFC 822. I'm not sure why they're using these different standards. However, Atom is the newer spec.

dnab




msg:4114900
 8:43 am on Apr 13, 2010 (gmt 0)

Thanks for the continued help and advice.

My pubDate seems to be in a correct format. example below:

Tue, 02 Feb 2010 18:00:00 +0000

Time on IE computer is also correct!

Also what is the etiquette at the moment, should I be providing both RSS 2 and Atom. Is it OK to not have RSS at all if Atom is the newer standard?

Thanks again.

bill




msg:4115498
 4:24 am on Apr 14, 2010 (gmt 0)

This advice from last year still holds true: RSS Good Practices: Pick a Format (Any Format) [webmasterworld.com]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved