| Drupal
How to Add a Custom Date Format in Drupal 8

In Drupal 8, the process of adding a new date format is substantially simpler than in Drupal 7.

In Drupal 7, there were several steps involved.

In Drupal 8, the process is substantially simpler:

  • Go to Configuration > Date and time formats.
  • You'll see that Drupal 8 ships with around a dozen formats, compared with 3 in Drupal 7.
How to Add a Custom Date Format in Drupal 8
  • Click the blue "Add format" button:

You can now add a date format directly into the "Format string" field.

You wil need to use the PHP syntax on this page. Drupal will give you a live preview of your date format:


About the author

Steve is the founder of OSTraining. Originally from the UK, he now lives in Sarasota in the USA. Steve's work straddles the line between teaching and web development.