Gets the list of defined date formats and attributes.
Return value
array
An associative array of date formats. The top-level keys are the
machine-readable names of the date formats. The values are associative
arrays with the following keys:
- name: The string human readable name of the date format.
- pattern: An associative array of patterns that will modify the format
of the date, keyed with 'php' for normal PHP date pattern and 'intl'
for the alternate pattern used by the IntlDateFormatter.
File
- drupal/core/modules/system/system.module, line 3649
- Configuration system that lets administrators modify the workings of the site.
Code
function system_get_date_formats() {
return config('system.date')
->get('formats');
}