agmark
14 years agoVisitor
Parsing pubDate in XML
I'm looking for suggestions on parsing the pubDate in an XML feed. The feed gives me a pubDate of:
I have no control over the time, so I'd prefer to strip off the "00:00:00 GMT" in the following parsing code:
Thanks again for any guidance!
~Mark
<pubDate>Wed, 9 Nov 2011 00:00:00 GMT</pubDate>
I have no control over the time, so I'd prefer to strip off the "00:00:00 GMT" in the following parsing code:
' release date
if item.GetNamedElements("blip:datestamp").Count() > 0
dt = CreateObject("roDateTime")
dt.FromISO8601String(ValidStr(item.GetNamedElements("blip:datestamp")[0].GetText()))
newItem.releaseDate = dt.AsDateStringNoParam()
else
newItem.releaseDate = ValidStr(item.pubdate.GetText())
end if
newItem.shortDescriptionLine2 = newItem.releaseDate
' media:content can be a child of <item> or of <media:group>
contentItems = item.GetNamedElements("media:content")
if contentItems.Count() = 0
tmp = item.GetNamedElements("media:group")
if tmp.Count() > 0
contentItems = tmp.GetNamedElements("media:content")
end if
end if
Thanks again for any guidance!
~Mark