How to parse <pubDate> in RSS

Hi Experts,

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

Ruby G.

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

Datum: Sat, 6 Sep 2008 08:53:52 +0900
Von: Ruby G. [email protected]
An: [email protected]
Betreff: How to parse in RSS

Hi Experts,

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

Ruby G.

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

Hi Ruby G.,

if you remove the and the weekday, parsing works:

require “date”
text=“Wed, 23 Feb 2005 16:12:56 GMT”
text.gsub!(/</*pubDate>/,‘’)
text.gsub!(/^…,/,‘’)
p text #text=“23 Feb 2005 16:12:56 GMT”
p DateTime.parse(text)

Best regards,

Axel

From: Ruby G. [mailto:[email protected]]

Is there another way to get a valid date from pubDate in RSS like this

example:

Wed, 23 Feb 2005 16:12:56 GMT

…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