Change 

format_date(

 to:

Drupal::service('date.formatter')->format(

 

 

Saved you some valuable time?

Buy me a drink 🍺