function system_get_date_formats

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.
7 calls to system_get_date_formats()
Date::buildOptionsForm in drupal/core/modules/views/lib/Drupal/views/Plugin/views/field/Date.php
Default options form that provides the label widget that all fields should have.
DateFormatFormBase::validateForm in drupal/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php
Form validation handler.
DateTimeDefaultFormatter::settingsForm in drupal/core/modules/datetime/lib/Drupal/datetime/Plugin/field/formatter/DatetimeDefaultFormatter.php
Returns a form to configure settings for the formatter.
system_date_format_exists in drupal/core/modules/system/system.admin.inc
Checks if the chosen machine_name exists or not.
system_date_format_localize_form in drupal/core/modules/system/system.admin.inc
Form constructor for the date localization configuration form.

... See full list

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');
}