<pubDate>Fri, 30 Dec 2011 19:55:55 EST</pubDate>
dateIn = "Fri, 30 Dec 2011 19:55:55 EST"
ro = CreateObject ("roRegex", "(\d+)\s+([a-z]+)\s+(\d+)\s+(\d+:\d+:\d+)\D", "i")
da = ro.Match (dateIn)
ml = "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC"
mon% = (Instr (1, ml, Ucase (da [2])) - 1)/3 + 1
dateOut = da[3] + "-" + mon%.ToStr () + "-" + da [1] + " " + da [4]
print dateOut
newItem.releaseDate = ValidStr(item.pubdate.GetText()) 'parse date from rss feed
dateIn = newItem.releaseDate
ro = CreateObject ("roRegex", "(\d+)\s+([a-z]+)\s+(\d+)\s+(\d+:\d+:\d+)\D", "i")
da = ro.Match (dateIn)
ml = "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC"
mon% = (Instr (1, ml, Ucase (da [2])) - 1)/3 + 1
dateOut = da[3] + "-" + mon%.ToStr () + "-" + da [1] + " " + da [4]
dt.FromISO8601String(dateOut)
dateInSeconds = dt.asSeconds()
print dateOut
print "asSeconds = " dateInSeconds
print "-----------------------------"
dateTmp = util.convertDate(releaseDate)
' 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
releaseDate = ValidStr(item.pubdate.GetText())
dateTmp = util.convertDate(releaseDate)
newItem.releaseDate = dateTmp
end if
newItem.shortDescriptionLine2 = newItem.releaseDate
convertDate: NWM_UT_convertDate
Function NWM_UT_convertDate(inStr)
dateIn = inStr
ro = CreateObject ("roRegex", "(\d+)\s+([a-z]+)\s+(\d+)\s+(\d+:\d+:\d+)\D", "i")
da = ro.Match (dateIn)
ml = "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC"
mon% = (Instr (1, ml, Ucase (da [2])) - 1)/3 + 1
dateOut = da[3] + "-" + mon%.ToStr () + "-" + da [1] + " " + da [4]
dt=CreateObject("roDateTime")
dt.fromISO8601String(dateOut)
dateShrt = dt.AsDateString("short-month-short-weekday")
result = dateShrt
print dateShrt
return result
End Function
We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. You will not be able to log in or post new comments or kudos during this time. Read more here.
Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 12 and you may notice reduced functionality.
In the meantime, for additional assistance, visit our Support Site.
Thanks for your patience — we’re excited to share what’s next!