You are here

public function DateFormatter::formatTimeDiffUntil in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Datetime/DateFormatter.php \Drupal\Core\Datetime\DateFormatter::formatTimeDiffUntil()
  2. 9 core/lib/Drupal/Core/Datetime/DateFormatter.php \Drupal\Core\Datetime\DateFormatter::formatTimeDiffUntil()

File

core/lib/Drupal/Core/Datetime/DateFormatter.php, line 186

Class

DateFormatter
Provides a service to handle various date related functionality.

Namespace

Drupal\Core\Datetime

Code

public function formatTimeDiffUntil($timestamp, $options = []) {
  $request_time = $this->requestStack
    ->getCurrentRequest()->server
    ->get('REQUEST_TIME');
  return $this
    ->formatDiff($request_time, $timestamp, $options);
}