public DateFormatterInterface::format($timestamp, $type = 'medium', $format = '', $timezone = NULL, $langcode = NULL)
Formats a date, using a date type or a custom date format string.
int $timestamp: A UNIX timestamp to format.
string $type: (optional) The format to use, one of:
Defaults to 'medium'.
string $format: (optional) If $type is 'custom', a PHP date format string suitable for input to date(). Use a backslash to escape ordinary text, so it does not get interpreted as date format characters.
string|null $timezone: (optional) Time zone identifier, as described at http://php.net/manual/timezones.php Defaults to the time zone used to display the page.
string|null $langcode: (optional) Language code to translate to. NULL (default) means to use the user interface language for the page.
string A translated date string in the requested format. Since the format may contain user input, this value should be escaped when output.
public function format($timestamp, $type = 'medium', $format = '', $timezone = NULL, $langcode = NULL);
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Datetime!DateFormatterInterface.php/function/DateFormatterInterface::format/8.1.x