05.02.2026 | Mathias Grab

How to create a <pubDate> date pattern (RFC822) to be used with Views RSS feeds

 This snippet is an example config for a date format in Drupal which can be imported.

rss_feed_date_format.yml
langcode: en
status: true
dependencies: {  }
id: rss_feed_date_format
label: RFC822
locked: false
pattern: 'D, d M Y h:i:s O'

 

Change the date format via Sitebuilding
In the administrative menu open Configuration -> Region and language -> Date and time formats or open the path /admin/config/regional/date-time.
Then use the button "+ Add format".

Sitebuilding date format 1

 

 

Sitebuilding date format 2
  

Here you can give your new date format a label and enter D, d M Y h:i:s O as a fitting RFC822 <pubDate> format.

Sitebuilding date format 3

For more information about PHP date format options, see the official PHP documentation.

Issue:

RSS feeds require the date pattern to use RFC-822 format ('D, d M Y h:i:s O' | Wed, 02 Oct 2002 08:00:00 EST). The main problem is that CET (Central European Time) is not supported by this RFC standard so we have to switch to GMT (Greenwich Mean Time) + hhmm to have a valid value.

Solution:

Switch to GMT (Greenwich Mean Time) + hhmm to have a valid value.

Weitere DevBits

13.11.2025 | Peter Majmesku

Autowire services with the Autowire attribute in Drupal

Example.php
<?php

declare(strict_types=1);

namespace Drupal\my_module;

use Drupal\Core\Session\AccountInterface;
use Symfony\Component\DependencyInjection\Attribute\Autowire;

class Example {

  public function __construct(
    #[Autowire(service: 'current_user')]
    private readonly AccountInterface $currentUser,
  ) {
  }

  public function getCurrentUser(): AccountInterface {
    return $this->currentUser;
  }

}

my_module.services.yml
services:
  my_module.example:
    class: Drupal\my_module\Service\Example
    autowire: true
  Drupal\my_module\Service\Example: '@my_module.example'

php
services
yml / yaml
02.04.2026 | Michael Ebert

Set a custom theme to be used by Symfony Mailer

symfony_mailer.mailer_policy._.yml
configuration:
  email_theme:
    theme: my_custom_theme

yml / yaml
symfony
mail
themes