以下は、現在の日時を出力する。 print \Drupal::service('date.formatter')->format((new \DateTime())->getTimeStamp(), 'short');