Same name and namespace in other branches
- 8.9.x core/lib/Drupal/Core/Datetime/DateFormatter.php \Drupal\Core\Datetime\DateFormatter::formatTimeDiffSince()
- 9 core/lib/Drupal/Core/Datetime/DateFormatter.php \Drupal\Core\Datetime\DateFormatter::formatTimeDiffSince()
File
- core/
lib/ Drupal/ Core/ Datetime/ DateFormatter.php, line 195
Class
- DateFormatter
- Provides a service to handle various date related functionality.
Namespace
Drupal\Core\DatetimeCode
public function formatTimeDiffSince($timestamp, $options = []) {
$request_time = $this->requestStack
->getCurrentRequest()->server
->get('REQUEST_TIME');
return $this
->formatDiff($timestamp, $request_time, $options);
}