Get all the machine names of the date formats I have searched the Drupal documentation but until now I have not found the way to obtain the machine names of the date formats that the user creates from the Drupal administration.

They would be the formats that appear in the following route:

admin/config/regional/date-time


What would be the way to obtain them?
Is there any service for this?
Date formats are entities so you can use the Entity Type Manager service:

$formats = \Drupal::entityTypeManager()
  -&gt;getStorage('date_format')
  -&gt;loadMultiple();

$ids = array_keys($formats);