diff -u b/core/lib/Drupal/Core/Datetime/DateFormatter.php b/core/lib/Drupal/Core/Datetime/DateFormatter.php --- b/core/lib/Drupal/Core/Datetime/DateFormatter.php +++ b/core/lib/Drupal/Core/Datetime/DateFormatter.php @@ -129,7 +129,7 @@ * (optional) Language code to translate to. NULL (default) means to use * the user interface language for the page. * - * @return string|\Drupal\Component\Utility\SafeStringInterface + * @return string * A translated date string in the requested format. Since the format may * contain user input, this value should be escaped when output. */ diff -u b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php --- b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php +++ b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php @@ -89,7 +89,7 @@ * - langcode: (optional) String two letter language code used to control * the result of the format() method. Defaults to NULL. * - * @return string|\Drupal\Component\Utility\SafeStringInterface + * @return string * The formatted value of the date. Since the format may contain user input, * this value should be escaped when output. */