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