Formatting pubDate in RSS2.0

Source: Internet
Author: User
Tags rfc822
PubDate is a very important item when RSS2.0 is created. It records the article release time. However, the time format requirements under the RSS2.0 standard are strict and must comply with the rfc822 standard. For example, <pubDate> Fri, 22 Feb 2008 15:49:18 GMT </pubDate>. However, some websites in China use RSS2.0 but ignore this time format. As a result, some problems may occur when users subscribe to this source. Using C # to format the time to conform to the rfc822 standard is actually very simple:

DateTime. Now. AddHours (-8). ToString ("r ")

Why do we need to subtract 8 hours? Because the string formatted using ToString ("r") is GMT time, while we are using the + 8 time zone, we need to subtract 8 hours, I forgot to reduce the size by 8 hours at the beginning of the job bean recruitment network, so that all content will be published in the next 8 hours. I suggest you check the content after preparing the RSS to see if it is correct. Rss detection tool address: Workshop/

From: http://www.cqun.com/2010/12/rss20-pubdate.html#links

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.