function DateFormatterInterface::getSampleDateFormats

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Datetime/DateFormatterInterface.php \Drupal\Core\Datetime\DateFormatterInterface::getSampleDateFormats()
  2. 10 core/lib/Drupal/Core/Datetime/DateFormatterInterface.php \Drupal\Core\Datetime\DateFormatterInterface::getSampleDateFormats()
  3. 11.x core/lib/Drupal/Core/Datetime/DateFormatterInterface.php \Drupal\Core\Datetime\DateFormatterInterface::getSampleDateFormats()

Provides values for all date formatting characters for a given timestamp.

Parameters

string|null $langcode: (optional) Language code of the date format, if different from the site default language.

int|null $timestamp: (optional) The Unix timestamp to format, defaults to current time.

string|null $timezone: (optional) The timezone to use, if different from the site's default timezone.

Return value

array An array of formatted date values, indexed by the date format character.

See also

date()

1 method overrides DateFormatterInterface::getSampleDateFormats()
DateFormatter::getSampleDateFormats in core/lib/Drupal/Core/Datetime/DateFormatter.php
Provides values for all date formatting characters for a given timestamp.

File

core/lib/Drupal/Core/Datetime/DateFormatterInterface.php, line 85

Class

DateFormatterInterface
Provides an interface defining a date formatter.

Namespace

Drupal\Core\Datetime

Code

public function getSampleDateFormats($langcode = NULL, $timestamp = NULL, $timezone = NULL);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.