public DateFormatter::formatTimeDiffUntil($timestamp, $options = array())
Formats the time difference from the current request time to a timestamp.
$timestamp: A UNIX timestamp to compare against the current request time.
array $options: (optional) An associative array with additional options. The following keys can be used:
string|\Drupal\Core\Datetime\FormattedDateDiff A translated string representation of the difference between the given timestamp and the current request time. This interval is always positive.
Overrides DateFormatterInterface::formatTimeDiffUntil
\Drupal\Core\Datetime\DateFormatterInterface::formatDiff()
\Drupal\Core\Datetime\DateFormatterInterface::formatTimeDiffSince()
public function formatTimeDiffUntil($timestamp, $options = array()) { $request_time = $this->requestStack->getCurrentRequest()->server->get('REQUEST_TIME'); return $this->formatDiff($request_time, $timestamp, $options); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Datetime!DateFormatter.php/function/DateFormatter::formatTimeDiffUntil/8.1.x