A
A
Alexander Ivanov2018-06-14 22:06:19
PHP
Alexander Ivanov, 2018-06-14 22:06:19

What does feedvalidator.org swear at in RSS?

<pubDate>Thu, 9 Jun 2016 0:03:28 GMT</pubDate>
feedvalidator outputs the following:


line 411, column 43: pubDate must be an RFC-822 date-time: Thu, 9 Jun 2016 0:03:28 GMT (57 occurrences) [help]
Thu, 9 Jun 2016 0:03:28 GMT

In help:

Message
element must be an RFC-822 date-time
Explanation
Invalid date-time. The value specified must meet the Date and Time specifications as defined by RFC822, with the exception that the year should be expressed as four digits.
Solution
Change the date-time format to comply with RFC822. Here are examples of valid RFC822 date-times:
Wed, 02 Oct 2002 08:00:00 ESTWed, 02 Oct 2002 13:00:00 GMTWed, 02 Oct 2002 15:00:00 +0200
Common errors include localizing the month name or the days of the week, not using the exact abbreviation provided by the specification, or attempting to use a time zone name that is not listed. See Section 5.1 for the list of allowable values ​​for these portions of the date.
Here is an example of an invalid RFC822 date-time. This is commonly seen in RSS 1.0 feeds generated by older versions of Movable Type:
2002-10-02T08:00:00-05:00
Not clear? Disagree?
You might be able to find help in one of these fine resources.

I bring it out like this
<pubDate><?=date("D, j M Y G:i:s", strtotime($res['DATE_CREATE']))." GMT"?></pubDate>

It seems to me or the validator is buggy?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2018-06-15
@prototype_denis

<pubDate><?= date(\DateTime::RFC822, strtotime($res['DATE_CREATE']))." GMT" ?></pubDate>

or
<pubDate><?= date(DATE_RFC822, strtotime($res['DATE_CREATE']))." GMT" ?></pubDate>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question