0
私は強力なASPクラシック開発者ではありませんが、私は仕事でこのアプリケーションをサポートすることを任されています短い日付形式のRSSフィード日付。と私は解決策を見つけるように見えることはできません。RFC-32日付形式を短い日付(MM/DD/YYYY)でASPを指定する
私はこのフォーマットがあります。
Wed, 10 Jun 2009 12:46:13 +0000
を、私はこのフォーマットにそれを取得する必要があります:
06/10/2009
は、これまでのところ私は、ASPのために、このRSSフィードスクリプトをいじってきた:
<%
' change the RSSURL variable to the exact URL of the RSS Feed you want to pull
RSSURL = "{url to rss feed}"
Dim objHTTP ' this object is used to call the RSS Feed remotely
Dim RSSURL,RSSFeed ' these variables hold the URL and Content for the RSS Feed
Dim xmlRSSFeed ' this variable hold the XML data in a DOM Object
Dim objItems,objItem, objChild ' these variables are used to temporarily hold data from the various RSS Items
Dim title,description,link ' these are local variables that will hold the data to be displayed
Dim pubDate
Dim RSSOutput ' variable will hold the HTML that was converted from the RSS Feed
' this code requests the raw RSS/XML and saves the response as a string <RSSFeed>
Set objHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP")
objHTTP.open "GET",RSSURL,false
objHTTP.send
RSSFeed = objHTTP.responseText
' this code takes the raw RSSFeed and loads it into an XML Object
Set xmlRSSFeed = Server.CreateObject("MSXML2.DomDocument.4.0")
xmlRSSFeed.async = false
xmlRSSFeed.LoadXml(RSSFeed)
' this code disposes of the object we called the feed with
Set objHTTP = Nothing
' this is where you determine how to display the content from the RSS Feed
' this code grabs all the "items" in the RSS Feed
Set objItems = xmlRSSFeed.getElementsByTagName("item")
' this code disposes of the XML object that contained the entire feed
Set xmlRSSFeed = Nothing
' loop over all the items in the RSS Feed
For x = 0 to 3
' this code places the content from the various RSS nodes into local variables
Set objItem = objItems.item(x)
For Each objChild in objItem.childNodes
Select Case LCase(objChild.nodeName)
Case "title"
title = objChild.text
Case "link"
link = objChild.text
Case "description"
description = objChild.text
Case "pubdate"
pubDate = objChild.text
End Select
Next
' Format display output
RSSOutput = RSSOutput & "<tr><td valign='top' style='width:75px; height: 34px;' class='addresstext2'><b>"& pubDate &"</b></td><td valign='top'><a class=ccc href=""" & link & """>" & title & "</a></td></tr>"
Next
%>
私はRSSからpubDateを取得するので、それは文字列であると信じています。私はそれをCDateしようとすると型の不一致が発生し、Format()と同じ問題も試しました。誰もが必要なものにこの日付をフォーマットする方法を提案することはできますか?
ありがとうございます!
恐ろしいです、早かった!ありがとう、私はそこに逃したとは思わない、私はGoogleを介してRSSDate形式などの結果を見つけることができませんでした。 – Jakub
問題ありません。私はrssの日付形式がRFC822であることを知っていたので、vbscriptおよび/またはaspと組み合わせて検索しました。 – Espo