Drupal 8 : How to Get DateTime Format from Integer Unix Timestamp

You can output the current date and time as follows:

print \Drupal::service('date.formatter')->format((new \DateTime())->getTimeStamp(), 'short');