drupal 8 format_date code example
Example: drupal 8 date formater service
\Drupal::service('date.formatter')
->format($timestamp, $type, $format, $timezone, $langcode);
\Drupal::service('date.formatter')
->format($timestamp, $type, $format, $timezone, $langcode);