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

Submitted by admin on Thu, 03/01/2018 - 22:50

You can output the current date and time as follows:
print \Drupal::service('date.formatter')->format((new \DateTime())->getTimeStamp(), 'short');

Tags