Skip to main content

Formatting how date/time is displayed in Drupal 8/9

You can create a new date/time format by navigating to:

Admin -> Configuration -> Regional and Language -> Date and Time format and click on 'Add Format'.

Once you’ve created date format, you can control the way date is displayed on the node using preprocess function.

In {theme_name}.theme file, add the following lines

Subscribe to Date