Correct RSS date format

February 4, 2008 at 7:19 pm 2 comments

If you see a date like “01/02/07” in an RSS feed, what do you do?  You write a blog post about it. 

The applications that I am working on are reliant on some calculations using RSS dates.  I have noticed that the RSS date specification is probably the most taken for granted part of the RSS spec.  It is taken for granted because many consumers of RSS program around the date inconsistencies so there is not much of an outcry.  However, when you see a date like 01/02/07, you have to stop and say something. 

To those developers generating RSS feeds, please take a look at the RSS date format specifications as per the RSS specification.  I will summarize it here: 

The RSS date must conform to the RFC-822 (refer to the BNF for “date-time”  in section 5) date time format.  Examples of this format are: 

Wed, 04 Feb 2008 08:00:00 EST

Wed, 04 Feb 2008 13:00:00 GMT

Wed, 04 Feb 2008 15:00:00 +0200 

Do not just execute a stringifying method on your date object before writing it to the RSS feed.  Set the date format to the above mentioned format first before writing it to the RSS feed. 

To validate whether your date is correct, you can use http://feedvalidator.org

Advertisements

Entry filed under: Agile Software Development, Enterprise 2.0, Enterprise software, REST, RSS, Software Engineering, Web 2.0.

A LEGENDary tribute A case for standardizing blog templates

2 Comments Add your own

  • 1. Elliot  |  February 5, 2008 at 4:51 pm

    Dealing with date formats when parsing “RSS/ATOM-in-the-wild” can be a challenging task, due to both the fragmented nature of the RSS/ATOM standards and the variety of date formats one could theoretically expect to find in feeds (RFC 822, W3CDTF, RFC3339, etc.). There’s also malformed date formats, time zone abbreviations, and other minor items which can further muddy the date parsing/validation process. When we were building our RSS parsing/serialization engine, dates were probably one of the most tedious validation aspects we ran into (RSS/ATOM extensions and all their potential varying forms being the second). “Really Simple” just isn’t really the case if you’re parsing feeds — maybe if you’re just subscribing to them! 🙂

    Reply
  • 2. thecastex  |  May 15, 2009 at 3:02 pm

    Thnx dude.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

February 2008
M T W T F S S
« Jan   Mar »
 123
45678910
11121314151617
18192021222324
2526272829  

Most Recent Posts


%d bloggers like this: