How to parse <pubDate> in RSS

Hi Experts,

Is there another way to get a valid date from pubDate in RSS like this
example:
<pubDate>Wed, 23 Feb 2005 16:12:56 GMT</pubDate>
...to a format (YYYYMMDD hh:mm:ss) that is recognizable by the parsers?

Ruby Girl

···

--
Posted via http://www.ruby-forum.com/.

-------- Original-Nachricht --------

Datum: Sat, 6 Sep 2008 08:53:52 +0900
Von: Ruby Girl <rubyongirl@gmail.com>
An: ruby-talk@ruby-lang.org
Betreff: How to parse <pubDate> in RSS

Hi Experts,

Is there another way to get a valid date from pubDate in RSS like this
example:
<pubDate>Wed, 23 Feb 2005 16:12:56 GMT</pubDate>
...to a format (YYYYMMDD hh:mm:ss) that is recognizable by the parsers?

Ruby Girl
--
Posted via http://www.ruby-forum.com/\.

Hi Ruby Girl,

if you remove the <pubdate> and the weekday, parsing works:

require "date"
text="<pubDate>Wed, 23 Feb 2005 16:12:56 GMT</pubDate>"
text.gsub!(/<\/*pubDate>/,'')
text.gsub!(/^...,/,'')
p text #text="23 Feb 2005 16:12:56 GMT"
p DateTime.parse(text)

Best regards,

Axel

···

--
GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!

# Is there another way to get a valid date from pubDate in RSS like this
# example:
# <pubDate>Wed, 23 Feb 2005 16:12:56 GMT</pubDate>
# ...to a format (YYYYMMDD hh:mm:ss) that is recognizable by
# the parsers?

if you downloaded that using ruby rss, that would automatically be parsed. pls post your rss code.

kind regards -botp

···

From: Ruby Girl [mailto:rubyongirl@gmail.com]