Problem/Motivation
We have multilingual content and created one feed for all language contents. By setting the language to match the interface language, we essentially have a feed per language (/en/news/feed, /ja/news/feed, etc) with just one single Feed display.
We expect the non-English feed to have the RFC-822 formatted date in English, but they turned out translated, and thus not RFC-822 compliant any more:


Steps to reproduce
1. Create a feed in a view of a multilingual site.
2. Filter the feed by language = interface language.
Proposed resolution
Is there a native or custom hook we can use to force the date format to use RFC-822 formatting?
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | Dateformat.png | 49.14 KB | dariemlazaro |
| #8 | viewtwig.png | 47.61 KB | dariemlazaro |
| Screenshot 2026-02-25 at 17.14.11.png | 14.66 KB | hktang | |
| Screenshot 2026-02-25 at 17.13.55.png | 12.75 KB | hktang |
Comments
Comment #2
hktang commentedComment #3
hktang commentedComment #4
idebr commentedYou can delete the localization for the rfc822 date format, so it matches the default format: https://git.drupalcode.org/project/views_rss/-/blob/8.x-2.x/config/insta...
Comment #5
hktang commentedThank you very much for the pointer. I deleted the translations for days of week and month names, and the pubDate is correctly picked up by the reader I tested with.
It seems the year format (like 2026) has been shortened (26). Is there a translation string that we can unset?
Also, I have not evaluated whether other parts of our system uses those translations -- so far it looks fine though... In case they are used elsewhere, another approach may be needed. Is there a native/custom hook we can use to alter this behavior?
Comment #6
idebr commentedThe date format was introduced in #3413726: Date values should be in RFC-822 format, not RFC-2822 specifically for RSS, so it is probably safe to change the year formatting in your installation.
There is an issue available to change the year format to 4 digits programmatically, see #3492994: pubDate has invalid year format
Comment #7
besek commentedI have the same issue with the date being formatted in Polish:
ndz., 29 mar 2026 20:31:33 +0200
(this is after I already changed year from 2-digits to 4-digits)
But the issue with name of the day and month remains and is causing errors in newsreaders.
Deleting rfc822 core.date_format.rfc822 is not helping.
What is interesting, the channel lastBuildDate is correct, but the items pubDate is in the wrong format
Comment #8
dariemlazaroI ran into the same problem and found a partial solution.
Set the custom format for RFC-822 to "D, d M Y H:i:s O"
Then I overwrite the field output with the Twig date() filter that forces the use of English.
With that, the elements are translated correctly, but the channel date doesn't seem to show the year with 4 digits.
Taking this into account, to avoid date translations in elements, simply add/modify a tpl (twig) with the date() filter on the module. The only remaining step is to format the year to 4 digits in the channel date.