[REBOL] Re: REBOL Script to convert REBOL format to RSS XML
From: greggirwin::mindspring::com at: 31-Dec-2004 9:51
Hi Premshree,
PP> Some rework may be required for the pubDate, though. The to-idate
PP> returns something like "Thu, 30 Dec 2004 0:00 +0000". For it to be
PP> validated, it must be "Thu, 30 Dec 2004 00:00:00 +0000". The change is
PP> required in the time, that is. It's a minor problem, though.
TO-IDATE should probably be fixed then, if RFC822 is the spec it's
targeting. How about this for a quick patch?
to-itime: func [
"Returns a standard internet time string (two digits for each segment)"
time [time!]
/local form-num
][
form-num: func [num] [either 1 = length? num: form num [join #"0" num] [num]]
rejoin [form-num time/hour ":" form-num time/minute ":" form-num round time/second]
]
to-idate: func [
"Returns a standard Internet date string."
date [date!]
/local str
][
str: form date/zone
remove find str ":"
if (first str) <> #"-" [insert str #"+"]
if (length? str) <= 4 [insert next str #"0"]
head insert str reform [
pick ["Mon," "Tue," "Wed," "Thu," "Fri," "Sat," "Sun,"] date/weekday
date/day
pick ["Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"] date/month
date/year to-itime date/time ""
]
]
-- Gregg