我尝试使用asp3将RFC822日期格式(从rss)转换为标准日期/时间格式。
谢谢
发布于 2011-04-13 18:37:11
很好的解决方案-分钟并不总是两位数-如果分钟只是一位数,你需要填充这些数字(我认为CDate去掉了那个零)
例如:
dim theminutes..。
tempDate = cdate(tempDate)
if Len(Minute(toReturn))=1 then
theminutes = "0" & Minute(toReturn)
else
theminutes = Minute(toReturn)
end if
RFC822_to_date = day(tempDate )&"-"&month(tempDate )&"-"&year(tempDate )&" "&hour(tempDate )&":"&theminutes&":00"发布于 2010-12-14 08:46:36
看看这个经典的ASP RSS reader的源代码。
有一些时髦的函数涉及到JScript的使用,看起来它们将为您工作。
看起来您需要VBScript函数parseDate和newDate,以及两个JScript函数。
发布于 2010-12-14 16:21:05
function RFC822_to_date (orginalDate )
tempDate = trim(right(orginalDate ,(len(orginalDate )-instr(orginalDate,","))))
tempDate = left(tempDate ,(len(tempDate)-5))
tempDate = cdate(tempDate )
RFC822_to_date = day(tempDate )&"-"&month(tempDate )&"-"&year(tempDate )&" "&hour(tempDate )&":"&minute(tempDate )&":00"
end function https://stackoverflow.com/questions/4434083
复制相似问题