Corrected the Rss Date Format error of KingCms.

Source: Internet
Author: User

 

The date format of the Rss file generated by kingcms is generated using the now () function and does not comply with the Rss writing specifications, you can use the following function to convert the asp date format to the date format supported by Rss:

'Time Conversion Function, compliant with rfc822 Standard
Private Function return_RFC822_Date (byVal myDate, byVal TimeZone)
Dim myDay, myDays, myMonth, myYear
Dim myHours, myMinutes, mySeconds
MyDate = CDate (myDate)
MyDay = EnWeekDayName (myDate)
MyDays = Right ("00" & Day (myDate), 2)
MyMonth = EnMonthName (myDate)
MyYear = Year (myDate)
MyHours = Right ("00" & Hour (myDate), 2)
MyMinutes = Right ("00" & Minute (myDate), 2)
MySeconds = Right ("00" & Second (myDate), 2)
Return_RFC822_Date = myDay &","&_
MyDays &""&_
MyMonth &""&_
MyYear &""&_
MyHours &":"&_
MyMinutes &":"&_
MySeconds &""&_
TimeZone
End Function

'Week Conversion Function
Private Function EnWeekDayName (InputDate)
Dim Result
Select Case WeekDay (InputDate, 1)
Case 1: Result = "Sun"
Case 2: Result = "Mon"
Case 3: Result = "Tue"
Case 4: Result = "Wed"
Case 5: Result = "Thu"
Case 6: Result = "Fri"
Case 7: Result = "Sat"
End Select

EnWeekDayName = Result
End Function

'Month Conversion Function
Private Function EnMonthName (InputDate)
Dim Result
Select Case Month (InputDate)
Case 1: Result = "Jan"
Case 2: Result = "Feb"
Case 3: Result = "Mar"
Case 4: Result = "Apr"
Case 5: Result = "May"
Case 6: Result = "Jun"
Case 7: Result = "Jul"
Case 8: Result = "Aug"
Case 9: Result = "Sep"
Case 10: Result = "Oct"
Case 11: Result = "Nov"
Case 12: Result = "Dec"
End Select

EnMonthName = Result
End Function

MsgBox return_RFC822_Date (Now (), "GMT ")

 

Excerpted from: space in the red dust

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.