I am trying to write a script to parse a date from an RSS feed into a different format.
It comes in "1/1/20 1:00:00 PM"
I want it to read "Wednesday, January 1 | 1:00 PM"
I am trying the following, but not sure if I am off base here with the language:
Sub hcrss5(xmlFileName$ as String, itemsByIndex as object, itemsByTitle as Object, userVariables As Object)
xml = CreateObject("roXMLElement")
if not xml.Parse(ReadAsciiFile(xmlFileName$)) then
print "xml read failed"
else
dateTime$ = itemXML.pubdate.GetText()
dateTimeParsed$ = DateTime.parse(dateTime$, "DDDD/MMMM D/YYYY"+" | "+"hh:mm A")
if type(xml.channel.item) = "roXMLList" then
index% = 0
for each itemXML in xml.channel.item
itemsByIndex.push(itemXML.title.GetText())
itemsByIndex.push(itemXML.datetimeparsed$.GetText())
itemsByIndex.push(itemXML.calendar.GetText())
itemsByIndex.push(itemXML.description.GetText())
itemsByIndex.push(itemXML.location.GetText())
index% = index%+1
next
endif
endif
DeleteFile(xmlfilename$)
end Sub