diff --git a/core/includes/batch.inc b/core/includes/batch.inc
index 8bd33b7..02089bb 100644
--- a/core/includes/batch.inc
+++ b/core/includes/batch.inc
@@ -319,9 +319,9 @@ function _batch_process() {
       '@total'      => $total,
       '@current'    => floor($current),
       '@percentage' => $percentage,
-      '@elapsed'    => format_interval($elapsed / 1000),
+      '@elapsed'    => \Drupal::service('date')->formatInterval($elapsed / 1000),
       // If possible, estimate remaining processing time.
-      '@estimate'   => ($current > 0) ? format_interval(($elapsed * ($total - $current) / $current) / 1000) : '-',
+      '@estimate'   => ($current > 0) ? \Drupal::service('date')->formatInterval(($elapsed * ($total - $current) / $current) / 1000) : '-',
     );
     $message = strtr($progress_message, $values);
     if (!empty($task_message)) {
@@ -410,7 +410,7 @@ function _batch_finished() {
       if (is_callable($batch_set['finished'])) {
         $queue = _batch_queue($batch_set);
         $operations = $queue->getAllItems();
-        call_user_func_array($batch_set['finished'], array($batch_set['success'], $batch_set['results'], $operations, format_interval($batch_set['elapsed'] / 1000)));
+        call_user_func_array($batch_set['finished'], array($batch_set['success'], $batch_set['results'], $operations, \Drupal::service('date')->formatInterval($batch_set['elapsed'] / 1000)));
       }
     }
   }
diff --git a/core/modules/aggregator/aggregator.theme.inc b/core/modules/aggregator/aggregator.theme.inc
index c65a3cf..9282b78 100644
--- a/core/modules/aggregator/aggregator.theme.inc
+++ b/core/modules/aggregator/aggregator.theme.inc
@@ -33,7 +33,7 @@ function template_preprocess_aggregator_item(&$variables) {
     $variables['source_title'] = String::checkPlain($item->ftitle);
   }
   if (date('Ymd', $item->getPostedTime()) == date('Ymd')) {
-    $variables['source_date'] = t('%ago ago', array('%ago' => format_interval(REQUEST_TIME - $item->getPostedTime())));
+    $variables['source_date'] = t('%ago ago', array('%ago' => \Drupal::service('date')->formatInterval(REQUEST_TIME - $item->getPostedTime())));
   }
   else {
     $variables['source_date'] = format_date($item->getPostedTime(), 'medium');
@@ -121,7 +121,7 @@ function template_preprocess_aggregator_summary_item(&$variables) {
       'datetime' => format_date($item->getPostedTime(), 'html_datetime', '', 'UTC'),
       'class' => array('feed-item-age',),
     ),
-    '#text' => t('%age old', array('%age' => format_interval(REQUEST_TIME - $item->getPostedTime()))),
+    '#text' => t('%age old', array('%age' => \Drupal::service('date')->formatInterval(REQUEST_TIME - $item->getPostedTime()))),
     '#html' => TRUE,
   );
 }
@@ -161,7 +161,7 @@ function template_preprocess_aggregator_feed_source(&$variables) {
   $variables['source_url'] = check_url(url($feed->getWebsiteUrl(), array('absolute' => TRUE)));
 
   if ($feed->checked) {
-    $variables['last_checked'] = t('@time ago', array('@time' => format_interval(REQUEST_TIME - $feed->getLastCheckedTime())));
+    $variables['last_checked'] = t('@time ago', array('@time' => \Drupal::service('date')->formatInterval(REQUEST_TIME - $feed->getLastCheckedTime())));
   }
   else {
     $variables['last_checked'] = t('never');
diff --git a/core/modules/aggregator/src/Controller/AggregatorController.php b/core/modules/aggregator/src/Controller/AggregatorController.php
index b5ca53d..4b87216 100644
--- a/core/modules/aggregator/src/Controller/AggregatorController.php
+++ b/core/modules/aggregator/src/Controller/AggregatorController.php
@@ -9,9 +9,11 @@
 
 use Drupal\Component\Utility\Xss;
 use Drupal\Core\Controller\ControllerBase;
+use Drupal\Core\Datetime\Date as DateService;
 use Drupal\aggregator\FeedInterface;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Returns responses for aggregator module routes.
@@ -19,6 +21,32 @@
 class AggregatorController extends ControllerBase {
 
   /**
+   * The date service.
+   *
+   * @var \Drupal\Core\Datetime\Date
+   */
+  protected $dateService;
+
+  /**
+   * Constructs a \Drupal\aggregator\Controller\AggregatorController object.
+   *
+   * @param \Drupal\Core\Datetime\Date $date_service
+   *    The date service.
+   */
+  public function __construct(DateService $date_service) {
+    $this->dateService = $date_service;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container) {
+    return new static(
+      $container->get('date')
+    );
+  }
+
+  /**
    * Presents the aggregator feed creation form.
    *
    * @return array
@@ -114,11 +142,11 @@ public function adminOverview() {
     foreach ($feeds as $feed) {
       $row = array();
       $row[] = l($feed->label(), "aggregator/sources/" . $feed->id());
-      $row[] = format_plural($entity_manager->getStorage('aggregator_item')->getItemCount($feed), '1 item', '@count items');
+      $row[] = $this->dateService->formatInterval($entity_manager->getStorage('aggregator_item')->getItemCount($feed), '1 item', '@count items');
       $last_checked = $feed->getLastCheckedTime();
       $refresh_rate = $feed->getRefreshRate();
-      $row[] = ($last_checked ? $this->t('@time ago', array('@time' => format_interval(REQUEST_TIME - $last_checked))) : $this->t('never'));
-      $row[] = ($last_checked && $refresh_rate ? $this->t('%time left', array('%time' => format_interval($last_checked + $refresh_rate - REQUEST_TIME))) : $this->t('never'));
+      $row[] = ($last_checked ? $this->t('@time ago', array('@time' => $this->dateService->formatInterval(REQUEST_TIME - $last_checked))) : $this->t('never'));
+      $row[] = ($last_checked && $refresh_rate ? $this->t('%time left', array('%time' => $this->dateService->formatInterval($last_checked + $refresh_rate - REQUEST_TIME))) : $this->t('never'));
       $links['edit'] = array(
         'title' => $this->t('Edit'),
         'route_name' => 'aggregator.feed_configure',
diff --git a/core/modules/aggregator/src/Entity/Feed.php b/core/modules/aggregator/src/Entity/Feed.php
index 16d4af5..7aff3d0 100644
--- a/core/modules/aggregator/src/Entity/Feed.php
+++ b/core/modules/aggregator/src/Entity/Feed.php
@@ -162,7 +162,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
       ));
 
     $intervals = array(900, 1800, 3600, 7200, 10800, 21600, 32400, 43200, 64800, 86400, 172800, 259200, 604800, 1209600, 2419200);
-    $period = array_map('format_interval', array_combine($intervals, $intervals));
+    $period = array_map(array(\Drupal::service('date'), 'formatInterval'), array_combine($intervals, $intervals));
     $period[AGGREGATOR_CLEAR_NEVER] = t('Never');
 
     $fields['refresh'] = FieldDefinition::create('list_integer')
diff --git a/core/modules/aggregator/src/Form/OpmlFeedAdd.php b/core/modules/aggregator/src/Form/OpmlFeedAdd.php
index 3e2f538..0613f48 100644
--- a/core/modules/aggregator/src/Form/OpmlFeedAdd.php
+++ b/core/modules/aggregator/src/Form/OpmlFeedAdd.php
@@ -68,7 +68,7 @@ public function getFormId() {
    */
   public function buildForm(array $form, array &$form_state) {
     $intervals = array(900, 1800, 3600, 7200, 10800, 21600, 32400, 43200, 64800, 86400, 172800, 259200, 604800, 1209600, 2419200);
-    $period = array_map('format_interval', array_combine($intervals, $intervals));
+    $period = array_map(array(\Drupal::service('date'), 'formatInterval'), array_combine($intervals, $intervals));
 
     $form['upload'] = array(
       '#type' => 'file',
diff --git a/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php b/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php
index 058ba18..aee056d 100644
--- a/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php
+++ b/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php
@@ -13,6 +13,7 @@
 use Drupal\aggregator\FeedInterface;
 use Drupal\Core\Database\Database;
 use Drupal\Core\Config\ConfigFactoryInterface;
+use Drupal\Core\Datetime\Date as DateService;
 use Drupal\Core\Entity\Query\QueryInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -52,6 +53,13 @@ class DefaultProcessor extends AggregatorPluginSettingsBase implements Processor
   protected $itemStorage;
 
   /**
+   * The date service.
+   *
+   * @var \Drupal\Core\Datetime\Date
+   */
+  protected $dateService;
+
+  /**
    * Constructs a DefaultProcessor object.
    *
    * @param array $configuration
@@ -66,11 +74,14 @@ class DefaultProcessor extends AggregatorPluginSettingsBase implements Processor
    *   The entity query object for feed items.
    * @param \Drupal\aggregator\ItemStorageInterface $item_storage
    *   The entity storage for feed items.
+   * @param \Drupal\Core\Datetime\Date $date_service
+   *   The date service.
    */
-  public function __construct(array $configuration, $plugin_id, $plugin_definition, ConfigFactoryInterface $config, QueryInterface $item_query, ItemStorageInterface $item_storage) {
+  public function __construct(array $configuration, $plugin_id, $plugin_definition, ConfigFactoryInterface $config, QueryInterface $item_query, ItemStorageInterface $item_storage, DateService $date_service) {
     $this->configFactory = $config;
     $this->itemStorage = $item_storage;
     $this->itemQuery = $item_query;
+    $this->dateService = $date_service;
     // @todo Refactor aggregator plugins to ConfigEntity so merging
     //   the configuration here is not needed.
     parent::__construct($configuration + $this->getConfiguration(), $plugin_id, $plugin_definition);
@@ -86,7 +97,8 @@ public static function create(ContainerInterface $container, array $configuratio
       $plugin_definition,
       $container->get('config.factory'),
       $container->get('entity.query')->get('aggregator_item'),
-      $container->get('entity.manager')->getStorage('aggregator_item')
+      $container->get('entity.manager')->getStorage('aggregator_item'),
+      $container->get('date')
     );
   }
 
@@ -98,10 +110,10 @@ public function buildConfigurationForm(array $form, array &$form_state) {
     $info = $this->getPluginDefinition();
     $counts = array(3, 5, 10, 15, 20, 25);
     $items = array_map(function ($count) {
-      return format_plural($count, '1 item', '@count items');
+      return $this->dateService->formatInterval($count, '1 item', '@count items');
     }, array_combine($counts, $counts));
     $intervals = array(3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200, 4838400, 9676800);
-    $period = array_map('format_interval', array_combine($intervals, $intervals));
+    $period = array_map(array($this->dateService, 'formatInterval'), array_combine($intervals, $intervals));
     $period[AGGREGATOR_CLEAR_NEVER] = t('Never');
 
     $form['processors'][$info['id']] = array();
diff --git a/core/modules/block/src/BlockBase.php b/core/modules/block/src/BlockBase.php
index 707212e..4642c3e 100644
--- a/core/modules/block/src/BlockBase.php
+++ b/core/modules/block/src/BlockBase.php
@@ -72,7 +72,6 @@ public function label() {
    */
   public function __construct(array $configuration, $plugin_id, $plugin_definition) {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
-
     $this->setConfiguration($configuration);
   }
 
@@ -234,7 +233,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
     // Identical options to the ones for page caching.
     // @see \Drupal\system\Form\PerformanceForm::buildForm()
     $period = array(0, 60, 180, 300, 600, 900, 1800, 2700, 3600, 10800, 21600, 32400, 43200, 86400);
-    $period = array_map('format_interval', array_combine($period, $period));
+    $period = array_map(array(\Drupal::service('date'), 'formatInterval'), array_combine($period, $period));
     $period[0] = '<' . t('no caching') . '>';
     $period[\Drupal\Core\Cache\Cache::PERMANENT] = t('Forever');
     $form['cache'] = array(
diff --git a/core/modules/block/src/Tests/BlockInterfaceTest.php b/core/modules/block/src/Tests/BlockInterfaceTest.php
index 77cdc7a..bd4c55c 100644
--- a/core/modules/block/src/Tests/BlockInterfaceTest.php
+++ b/core/modules/block/src/Tests/BlockInterfaceTest.php
@@ -61,7 +61,7 @@ public function testBlockInterface() {
     $definition = $display_block->getPluginDefinition();
 
     $period = array(0, 60, 180, 300, 600, 900, 1800, 2700, 3600, 10800, 21600, 32400, 43200, 86400);
-    $period = array_map('format_interval', array_combine($period, $period));
+    $period = array_map(array(\Drupal::service('date'), 'formatInterval'), array_combine($period, $period));
     $period[0] = '<' . t('no caching') . '>';
     $period[\Drupal\Core\Cache\Cache::PERMANENT] = t('Forever');
     $contexts = \Drupal::service("cache_contexts")->getLabels();
diff --git a/core/modules/comment/src/Tests/CommentTokenReplaceTest.php b/core/modules/comment/src/Tests/CommentTokenReplaceTest.php
index 1e4ac3a..27b6e39 100644
--- a/core/modules/comment/src/Tests/CommentTokenReplaceTest.php
+++ b/core/modules/comment/src/Tests/CommentTokenReplaceTest.php
@@ -59,8 +59,8 @@ function testCommentTokenReplacement() {
     $tests['[comment:body]'] = $comment->comment_body->processed;
     $tests['[comment:url]'] = url('comment/' . $comment->id(), $url_options + array('fragment' => 'comment-' . $comment->id()));
     $tests['[comment:edit-url]'] = url('comment/' . $comment->id() . '/edit', $url_options);
-    $tests['[comment:created:since]'] = format_interval(REQUEST_TIME - $comment->getCreatedTime(), 2, $language_interface->id);
-    $tests['[comment:changed:since]'] = format_interval(REQUEST_TIME - $comment->getChangedTime(), 2, $language_interface->id);
+    $tests['[comment:created:since]'] = \Drupal::service('date')->formatInterval(REQUEST_TIME - $comment->getCreatedTime(), 2, $language_interface->id);
+    $tests['[comment:changed:since]'] = \Drupal::service('date')->formatInterval(REQUEST_TIME - $comment->getChangedTime(), 2, $language_interface->id);
     $tests['[comment:parent:cid]'] = $comment->hasParentComment() ? $comment->getParentComment()->id() : NULL;
     $tests['[comment:parent:title]'] = String::checkPlain($parent_comment->getSubject());
     $tests['[comment:node:nid]'] = $comment->getCommentedEntityId();
diff --git a/core/modules/contact/src/Controller/ContactController.php b/core/modules/contact/src/Controller/ContactController.php
index df720bc..4407bf2 100644
--- a/core/modules/contact/src/Controller/ContactController.php
+++ b/core/modules/contact/src/Controller/ContactController.php
@@ -8,6 +8,7 @@
 namespace Drupal\contact\Controller;
 
 use Drupal\Core\Controller\ControllerBase;
+use Drupal\Core\Datetime\Date as DateService;
 use Drupal\Core\Flood\FloodInterface;
 use Drupal\contact\CategoryInterface;
 use Drupal\user\UserInterface;
@@ -29,13 +30,23 @@ class ContactController extends ControllerBase {
   protected $flood;
 
   /**
+   * The date service.
+   *
+   * @var \Drupal\Core\Datetime\Date
+   */
+  protected $dateService;
+
+  /**
    * Constructs a ContactController object.
    *
    * @param \Drupal\Core\Flood\FloodInterface $flood
    *   The flood service.
+   * @param \Drupal\Core\Datetime\Date $date_service
+   *   The date service.
    */
-  public function __construct(FloodInterface $flood) {
+  public function __construct(FloodInterface $flood, DateService $date_service) {
     $this->flood = $flood;
+    $this->dateService = $date_service;
   }
 
   /**
@@ -43,7 +54,8 @@ public function __construct(FloodInterface $flood) {
    */
   public static function create(ContainerInterface $container) {
     return new static(
-      $container->get('flood')
+      $container->get('flood'),
+      $container->get('date')
     );
   }
 
@@ -131,7 +143,7 @@ protected function contactFloodControl() {
     if (!$this->flood->isAllowed('contact', $limit, $interval)) {
       drupal_set_message($this->t('You cannot send more than %limit messages in @interval. Try again later.', array(
         '%limit' => $limit,
-        '@interval' => format_interval($interval),
+        '@interval' => $this->dateService->formatInterval($interval),
       )), 'error');
       throw new AccessDeniedHttpException();
     }
diff --git a/core/modules/contact/src/Tests/ContactPersonalTest.php b/core/modules/contact/src/Tests/ContactPersonalTest.php
index eb033bd..f004d39 100644
--- a/core/modules/contact/src/Tests/ContactPersonalTest.php
+++ b/core/modules/contact/src/Tests/ContactPersonalTest.php
@@ -209,7 +209,7 @@ function testPersonalContactFlood() {
 
     // Submit contact form one over limit.
     $this->drupalGet('user/' . $this->contact_user->id(). '/contact');
-    $this->assertRaw(t('You cannot send more than %number messages in @interval. Try again later.', array('%number' => $flood_limit, '@interval' => format_interval(\Drupal::config('contact.settings')->get('flood.interval')))), 'Normal user denied access to flooded contact form.');
+    $this->assertRaw(t('You cannot send more than %number messages in @interval. Try again later.', array('%number' => $flood_limit, '@interval' => \Drupal::service('date')->formatInterval(\Drupal::config('contact.settings')->get('flood.interval')))), 'Normal user denied access to flooded contact form.');
 
     // Test that the admin user can still access the contact form even though
     // the flood limit was reached.
diff --git a/core/modules/contact/src/Tests/ContactSitewideTest.php b/core/modules/contact/src/Tests/ContactSitewideTest.php
index 2be4208..8321c44 100644
--- a/core/modules/contact/src/Tests/ContactSitewideTest.php
+++ b/core/modules/contact/src/Tests/ContactSitewideTest.php
@@ -212,7 +212,7 @@ function testSiteWideContact() {
     // Submit contact form one over limit.
     $this->drupalGet('contact');
     $this->assertResponse(403);
-    $this->assertRaw(t('You cannot send more than %number messages in @interval. Try again later.', array('%number' => \Drupal::config('contact.settings')->get('flood.limit'), '@interval' => format_interval(600))));
+    $this->assertRaw(t('You cannot send more than %number messages in @interval. Try again later.', array('%number' => \Drupal::config('contact.settings')->get('flood.limit'), '@interval' => \Drupal::service('date')->formatInterval(600))));
 
     // Test listing controller.
     $this->drupalLogin($admin_user);
diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module
index 0c80786..b76873f 100644
--- a/core/modules/forum/forum.module
+++ b/core/modules/forum/forum.module
@@ -737,7 +737,7 @@ function template_preprocess_forum_submitted(&$variables) {
     $username = array('#theme' => 'username', '#account' => user_load($variables['topic']->uid));
     $variables['author'] = drupal_render($username);
   }
-  $variables['time'] = isset($variables['topic']->created) ? format_interval(REQUEST_TIME - $variables['topic']->created) : '';
+  $variables['time'] = isset($variables['topic']->created) ? \Drupal::service('date')->formatInterval(REQUEST_TIME - $variables['topic']->created) : '';
 }
 
 /**
diff --git a/core/modules/locale/locale.pages.inc b/core/modules/locale/locale.pages.inc
index f894f5f..681b19a 100644
--- a/core/modules/locale/locale.pages.inc
+++ b/core/modules/locale/locale.pages.inc
@@ -156,6 +156,6 @@ function template_preprocess_locale_translation_update_info(&$variables) {
 function template_preprocess_locale_translation_last_check(&$variables) {
   $last = $variables['last'];
   $variables['last_checked'] = ($last != NULL);
-  $variables['time'] = format_interval(REQUEST_TIME - $last);
+  $variables['time'] = \Drupal::service('date')->formatInterval(REQUEST_TIME - $last);
   $variables['link'] = l(t('Check manually'), 'admin/reports/translations/check', array('query' => drupal_get_destination()));
 }
diff --git a/core/modules/system/src/Form/CronForm.php b/core/modules/system/src/Form/CronForm.php
index 43a3013..21ed7ce 100644
--- a/core/modules/system/src/Form/CronForm.php
+++ b/core/modules/system/src/Form/CronForm.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\CronInterface;
+use Drupal\Core\Datetime\Date as DateService;
 use Drupal\Core\State\StateInterface;
 use Drupal\Core\Form\ConfigFormBase;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -34,6 +35,13 @@ class CronForm extends ConfigFormBase {
   protected $cron;
 
   /**
+   * The date service.
+   *
+   * @var \Drupal\Core\Datetime\Date
+   */
+  protected $dateService;
+
+  /**
    * Constructs a CronForm object.
    *
    * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
@@ -42,11 +50,14 @@ class CronForm extends ConfigFormBase {
    *   The state key value store.
    * @param \Drupal\Core\CronInterface $cron
    *   The cron service.
+   * @param \Drupal\Core\Datetime\Date $date_service
+   *   The date service.
    */
-  public function __construct(ConfigFactoryInterface $config_factory, StateInterface $state, CronInterface $cron) {
+  public function __construct(ConfigFactoryInterface $config_factory, StateInterface $state, CronInterface $cron, DateService $date_service) {
     parent::__construct($config_factory);
     $this->state = $state;
     $this->cron = $cron;
+    $this->dateService = $date_service;
   }
 
   /**
@@ -56,7 +67,8 @@ public static function create(ContainerInterface $container) {
     return new static(
       $container->get('config.factory'),
       $container->get('state'),
-      $container->get('cron')
+      $container->get('cron'),
+      $container->get('date')
     );
   }
 
@@ -82,7 +94,7 @@ public function buildForm(array $form, array &$form_state) {
       '#submit' => array(array($this, 'submitCron')),
     );
 
-    $status = '<p>' . t('Last run: %cron-last ago.', array('%cron-last' => format_interval(REQUEST_TIME - $this->state->get('system.cron_last')))) . '</p>';
+    $status = '<p>' . t('Last run: %cron-last ago.', array('%cron-last' => $this->dateService->formatInterval(REQUEST_TIME - $this->state->get('system.cron_last')))) . '</p>';
     $form['status'] = array(
       '#markup' => $status,
     );
@@ -102,7 +114,7 @@ public function buildForm(array $form, array &$form_state) {
       '#title' => t('Run cron every'),
       '#description' => t('More information about setting up scheduled tasks can be found by <a href="@url">reading the cron tutorial on drupal.org</a>.', array('@url' => url('http://drupal.org/cron'))),
       '#default_value' => $config->get('threshold.autorun'),
-      '#options' => array(0 => t('Never')) + array_map('format_interval', array_combine($options, $options)),
+      '#options' => array(0 => t('Never')) + array_map(array($this->dateService, 'formatInterval'), array_combine($options, $options)),
     );
 
     return parent::buildForm($form, $form_state);
diff --git a/core/modules/system/src/Form/FileSystemForm.php b/core/modules/system/src/Form/FileSystemForm.php
index e3c33f9..4a337b9 100644
--- a/core/modules/system/src/Form/FileSystemForm.php
+++ b/core/modules/system/src/Form/FileSystemForm.php
@@ -8,8 +8,11 @@
 namespace Drupal\system\Form;
 
 use Drupal\Component\Utility\String;
+use Drupal\Core\Config\ConfigFactoryInterface;
+use Drupal\Core\Datetime\Date as DateService;
 use Drupal\Core\StreamWrapper\PublicStream;
 use Drupal\Core\Form\ConfigFormBase;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Configure file system settings for this site.
@@ -17,6 +20,36 @@
 class FileSystemForm extends ConfigFormBase {
 
   /**
+   * The date service.
+   *
+   * @var \Drupal\Core\Datetime\Date
+   */
+  protected $dateService;
+
+  /**
+   * Constructs a FileSystemForm object.
+   *
+   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
+   *   The factory for configuration objects.
+   * @param \Drupal\Core\Datetime\Date $date_service
+   *   The date service.
+   */
+  public function __construct(ConfigFactoryInterface $config_factory, DateService $date_service) {
+    parent::__construct($config_factory);
+    $this->dateService = $date_service;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container) {
+    return new static (
+      $container->get('config.factory'),
+      $container->get('date')
+    );
+  }
+
+  /**
    * {@inheritdoc}
    */
   public function getFormId() {
@@ -70,7 +103,7 @@ public function buildForm(array $form, array &$form_state) {
     }
 
     $intervals = array(0, 21600, 43200, 86400, 604800, 2419200, 7776000);
-    $period = array_combine($intervals, array_map('format_interval', $intervals));
+    $period = array_combine($intervals, array_map(array($this->dateService, 'formatInterval'), $intervals));
     $period[0] = t('Never');
     $form['temporary_maximum_age'] = array(
       '#type' => 'select',
diff --git a/core/modules/system/src/Form/PerformanceForm.php b/core/modules/system/src/Form/PerformanceForm.php
index 7ab0ec1..e4f5cff 100644
--- a/core/modules/system/src/Form/PerformanceForm.php
+++ b/core/modules/system/src/Form/PerformanceForm.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Form\ConfigFormBase;
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Cache\CacheBackendInterface;
+use Drupal\Core\Datetime\Date as DateService;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -25,16 +26,26 @@ class PerformanceForm extends ConfigFormBase {
   protected $renderCache;
 
   /**
+   * The date service.
+   *
+   * @var \Drupal\Core\Datetime\Date
+   */
+  protected $dateService;
+
+  /**
    * Constructs a PerformanceForm object.
    *
    * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
    *   The factory for configuration objects.
    * @param \Drupal\Core\Cache\CacheBackendInterface $render_cache
+   * @param \Drupal\Core\Datetime\Date $date_service
+   *   The date service.
    */
-  public function __construct(ConfigFactoryInterface $config_factory, CacheBackendInterface $render_cache) {
+  public function __construct(ConfigFactoryInterface $config_factory, CacheBackendInterface $render_cache, DateService $date_service) {
     parent::__construct($config_factory);
 
     $this->renderCache = $render_cache;
+    $this->dateService = $date_service;
   }
 
   /**
@@ -43,7 +54,8 @@ public function __construct(ConfigFactoryInterface $config_factory, CacheBackend
   public static function create(ContainerInterface $container) {
     return new static(
       $container->get('config.factory'),
-      $container->get('cache.render')
+      $container->get('cache.render'),
+      $container->get('date')
     );
   }
 
@@ -82,7 +94,7 @@ public function buildForm(array $form, array &$form_state) {
     // Identical options to the ones for block caching.
     // @see \Drupal\block\BlockBase::buildConfigurationForm()
     $period = array(0, 60, 180, 300, 600, 900, 1800, 2700, 3600, 10800, 21600, 32400, 43200, 86400);
-    $period = array_map('format_interval', array_combine($period, $period));
+    $period = array_map(array($this->dateService, 'formatInterval'), array_combine($period, $period));
     $period[0] = '<' . t('no caching') . '>';
     $form['caching']['page_cache_maximum_age'] = array(
       '#type' => 'select',
diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php
index 8ff4b54..b9d025d 100644
--- a/core/modules/system/system.api.php
+++ b/core/modules/system/system.api.php
@@ -1665,7 +1665,7 @@ function hook_requirements($phase) {
     $cron_last = \Drupal::state()->get('system.cron_last');
 
     if (is_numeric($cron_last)) {
-      $requirements['cron']['value'] = t('Last run !time ago', array('!time' => format_interval(REQUEST_TIME - $cron_last)));
+      $requirements['cron']['value'] = t('Last run !time ago', array('!time' => \Drupal::service('date')->formatInterval(REQUEST_TIME - $cron_last)));
     }
     else {
       $requirements['cron'] = array(
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index 61a39d9..f93927e 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -309,7 +309,7 @@ function system_requirements($phase) {
     }
 
     // Set summary and description based on values determined above.
-    $summary = t('Last run !time ago', array('!time' => format_interval(REQUEST_TIME - $cron_last)));
+    $summary = t('Last run !time ago', array('!time' => \Drupal::service('date')->formatInterval(REQUEST_TIME - $cron_last)));
     $description = '';
     if ($severity != REQUIREMENT_INFO) {
       $description = t('Cron has not run recently.') . ' ' . $help;
diff --git a/core/modules/system/system.tokens.inc b/core/modules/system/system.tokens.inc
index 404cc13..6b5ad45 100644
--- a/core/modules/system/system.tokens.inc
+++ b/core/modules/system/system.tokens.inc
@@ -68,7 +68,7 @@ function system_token_info() {
   );
   $date['since'] = array(
     'name' => t("Time-since"),
-    'description' => t("A date in 'time-since' format. (%date)", array('%date' => format_interval(REQUEST_TIME - 360, 2))),
+    'description' => t("A date in 'time-since' format. (%date)", array('%date' => \Drupal::service('date')->formatInterval(REQUEST_TIME - 360, 2))),
   );
   $date['raw'] = array(
     'name' => t("Raw timestamp"),
@@ -157,7 +157,7 @@ function system_tokens($type, $tokens, array $data = array(), array $options = a
           break;
 
         case 'since':
-          $replacements[$original] = format_interval((REQUEST_TIME - $date), 2, $langcode);
+          $replacements[$original] = \Drupal::service('date')->formatInterval((REQUEST_TIME - $date), 2, $langcode);
           break;
 
         case 'raw':
diff --git a/core/modules/tracker/tracker.pages.inc b/core/modules/tracker/tracker.pages.inc
index 7baf977..b389020 100644
--- a/core/modules/tracker/tracker.pages.inc
+++ b/core/modules/tracker/tracker.pages.inc
@@ -92,7 +92,7 @@ function tracker_page($account = NULL) {
         'title' => array('data' => l($node->getTitle(), 'node/' . $node->id()) . ' ' . drupal_render($mark_build)),
         'author' => array('data' => array('#theme' => 'username', '#account' => $node->getOwner())),
         'replies' => array('class' => array('replies'), 'data' => $comments),
-        'last updated' => array('data' => t('!time ago', array('!time' => format_interval(REQUEST_TIME - $node->last_activity)))),
+        'last updated' => array('data' => t('!time ago', array('!time' => \Drupal::service('date')->formatInterval(REQUEST_TIME - $node->last_activity)))),
       );
 
       $rows[] = $row;
diff --git a/core/modules/user/src/Tests/UserAdminListingTest.php b/core/modules/user/src/Tests/UserAdminListingTest.php
index 770609a..13a79e5 100644
--- a/core/modules/user/src/Tests/UserAdminListingTest.php
+++ b/core/modules/user/src/Tests/UserAdminListingTest.php
@@ -90,7 +90,7 @@ public function testUserListing() {
     $expected_roles = array('custom_role_1', 'custom_role_2');
     $this->assertEqual($result_accounts[$role_account_name]['roles'], $expected_roles, 'Ensure roles are listed properly.');
 
-    $this->assertEqual($result_accounts[$timestamp_user]['member_for'], format_interval(REQUEST_TIME - $accounts[$timestamp_user]->created->value), 'Ensure the right member time is displayed.');
+    $this->assertEqual($result_accounts[$timestamp_user]['member_for'], \Drupal::service('date')->formatInterval(REQUEST_TIME - $accounts[$timestamp_user]->created->value), 'Ensure the right member time is displayed.');
   }
 
 }
diff --git a/core/modules/user/src/UserListBuilder.php b/core/modules/user/src/UserListBuilder.php
index 2f77813..2260cbc 100644
--- a/core/modules/user/src/UserListBuilder.php
+++ b/core/modules/user/src/UserListBuilder.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user;
 
+use Drupal\Core\Datetime\Date as DateService;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityListBuilder;
 use Drupal\Core\Entity\EntityStorageInterface;
@@ -29,6 +30,13 @@ class UserListBuilder extends EntityListBuilder {
   protected $queryFactory;
 
   /**
+   * The date service.
+   *
+   * @var \Drupal\Core\Datetime\Date
+   */
+  protected $dateService;
+
+  /**
    * Constructs a new UserListBuilder object.
    *
    * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
@@ -37,10 +45,13 @@ class UserListBuilder extends EntityListBuilder {
    *   The entity storage class.
    * @param \Drupal\Core\Entity\Query\QueryFactory $query_factory
    *   The entity query factory.
+   * @param \Drupal\Core\Datetime\Date $date_service
+   *   The date service.
    */
-  public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, QueryFactory $query_factory) {
+  public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, QueryFactory $query_factory, DateService $date_service) {
     parent::__construct($entity_type, $storage);
     $this->queryFactory = $query_factory;
+    $this->dateService = $date_service;
   }
 
   /**
@@ -50,7 +61,8 @@ public static function createInstance(ContainerInterface $container, EntityTypeI
     return new static(
       $entity_type,
       $container->get('entity.manager')->getStorage($entity_type->id()),
-      $container->get('entity.query')
+      $container->get('entity.query'),
+      $container->get('date')
     );
   }
 
@@ -127,9 +139,9 @@ public function buildRow(EntityInterface $entity) {
       '#theme' => 'item_list',
       '#items' => $users_roles,
     );
-    $row['member_for'] = format_interval(REQUEST_TIME - $entity->getCreatedTime());
+    $row['member_for'] = $this->dateService->formatInterval(REQUEST_TIME - $entity->getCreatedTime());
     $row['access'] = $entity->access ? $this->t('@time ago', array(
-      '@time' => format_interval(REQUEST_TIME - $entity->getLastAccessedTime()),
+      '@time' => $this->dateService->formatInterval(REQUEST_TIME - $entity->getLastAccessedTime()),
     )) : t('never');
     return $row + parent::buildRow($entity);
   }
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index 32c2571..7f94fba 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -500,7 +500,7 @@ function user_user_view(array &$build, UserInterface $account, EntityViewDisplay
   if ($display->getComponent('member_for')) {
     $build['member_for'] = array(
       '#type' => 'item',
-      '#markup' => '<h4 class="label">' . t('Member for') . '</h4> ' . format_interval(REQUEST_TIME - $account->getCreatedTime()),
+      '#markup' => '<h4 class="label">' . t('Member for') . '</h4> ' . \Drupal::service('date')->formatInterval(REQUEST_TIME - $account->getCreatedTime()),
     );
   }
 }
diff --git a/core/modules/views/src/Plugin/views/cache/Time.php b/core/modules/views/src/Plugin/views/cache/Time.php
index 054f545..03770ef 100644
--- a/core/modules/views/src/Plugin/views/cache/Time.php
+++ b/core/modules/views/src/Plugin/views/cache/Time.php
@@ -7,7 +7,10 @@
 
 namespace Drupal\views\Plugin\views\cache;
 
+use Drupal\Core\Datetime\Date as DateService;
 use Drupal\Core\Cache\Cache;
+use Drupal\Core\Plugin\PluginBase;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Simple caching of query results for Views displays.
@@ -27,6 +30,42 @@ class Time extends CachePluginBase {
    */
   protected $usesOptions = TRUE;
 
+  /**
+   * The date service.
+   *
+   * @var \Drupal\Core\Datetime\Date
+   */
+  protected $dateService;
+
+  /**
+   * Constructs a Time cache plugin object.
+   *
+   * @param array $configuration
+   *   A configuration array containing information about the plugin instance.
+   * @param string $plugin_id
+   *   The plugin_id for the plugin instance.
+   * @param mixed $plugin_definition
+   *   The plugin implementation definition.
+   * @param \Drupal\Core\Datetime\Date $date_service
+   *   The date service.
+   */
+  public function __construct(array $configuration, $plugin_id, $plugin_definition, DateService $date_service) {
+    $this->dateService = $date_service;
+    parent::__construct($configuration, $plugin_id, $plugin_definition);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
+    return new static(
+      $configuration,
+      $plugin_id,
+      $plugin_definition,
+      $container->get('date')
+    );
+  }
+
   protected function defineOptions() {
     $options = parent::defineOptions();
     $options['results_lifespan'] = array('default' => 3600);
@@ -40,7 +79,7 @@ protected function defineOptions() {
   public function buildOptionsForm(&$form, &$form_state) {
     parent::buildOptionsForm($form, $form_state);
     $options = array(60, 300, 1800, 3600, 21600, 518400);
-    $options = array_map('format_interval', array_combine($options, $options));
+    $options = array_map(array($this->dateService, 'formatInterval'), array_combine($options, $options));
     $options = array(-1 => t('Never cache')) + $options + array('custom' => t('Custom'));
 
     $form['results_lifespan'] = array(
@@ -97,7 +136,7 @@ public function validateOptionsForm(&$form, &$form_state) {
   public function summaryTitle() {
     $results_lifespan = $this->getLifespan('results');
     $output_lifespan = $this->getLifespan('output');
-    return format_interval($results_lifespan, 1) . '/' . format_interval($output_lifespan, 1);
+    return $this->dateService->formatInterval($results_lifespan, 1) . '/' . $this->dateService->formatInterval($output_lifespan, 1);
   }
 
   protected function getLifespan($type) {
diff --git a/core/modules/views/src/Plugin/views/field/Date.php b/core/modules/views/src/Plugin/views/field/Date.php
index e7a9bd7..c7cdb2c 100644
--- a/core/modules/views/src/Plugin/views/field/Date.php
+++ b/core/modules/views/src/Plugin/views/field/Date.php
@@ -144,19 +144,19 @@ public function render(ResultRow $values) {
       $time_diff = REQUEST_TIME - $value; // will be positive for a datetime in the past (ago), and negative for a datetime in the future (hence)
       switch ($format) {
         case 'raw time ago':
-          return format_interval($time_diff, is_numeric($custom_format) ? $custom_format : 2);
+          return $this->dateService->formatInterval($time_diff, is_numeric($custom_format) ? $custom_format : 2);
         case 'time ago':
-          return t('%time ago', array('%time' => format_interval($time_diff, is_numeric($custom_format) ? $custom_format : 2)));
+          return t('%time ago', array('%time' => $this->dateService->formatInterval($time_diff, is_numeric($custom_format) ? $custom_format : 2)));
         case 'raw time hence':
-          return format_interval(-$time_diff, is_numeric($custom_format) ? $custom_format : 2);
+          return $this->dateService->formatInterval(-$time_diff, is_numeric($custom_format) ? $custom_format : 2);
         case 'time hence':
-          return t('%time hence', array('%time' => format_interval(-$time_diff, is_numeric($custom_format) ? $custom_format : 2)));
+          return t('%time hence', array('%time' => $this->dateService->formatInterval(-$time_diff, is_numeric($custom_format) ? $custom_format : 2)));
         case 'raw time span':
-          return ($time_diff < 0 ? '-' : '') . format_interval(abs($time_diff), is_numeric($custom_format) ? $custom_format : 2);
+          return ($time_diff < 0 ? '-' : '') . $this->dateService->formatInterval(abs($time_diff), is_numeric($custom_format) ? $custom_format : 2);
         case 'inverse time span':
-          return ($time_diff > 0 ? '-' : '') . format_interval(abs($time_diff), is_numeric($custom_format) ? $custom_format : 2);
+          return ($time_diff > 0 ? '-' : '') . $this->dateService->formatInterval(abs($time_diff), is_numeric($custom_format) ? $custom_format : 2);
         case 'time span':
-          return t(($time_diff < 0 ? '%time hence' : '%time ago'), array('%time' => format_interval(abs($time_diff), is_numeric($custom_format) ? $custom_format : 2)));
+          return t(($time_diff < 0 ? '%time hence' : '%time ago'), array('%time' => $this->dateService->formatInterval(abs($time_diff), is_numeric($custom_format) ? $custom_format : 2)));
         case 'custom':
           if ($custom_format == 'r') {
             return format_date($value, $format, $custom_format, $timezone, 'en');
diff --git a/core/modules/views/src/Plugin/views/field/TimeInterval.php b/core/modules/views/src/Plugin/views/field/TimeInterval.php
index 35eae0b..659282a 100644
--- a/core/modules/views/src/Plugin/views/field/TimeInterval.php
+++ b/core/modules/views/src/Plugin/views/field/TimeInterval.php
@@ -7,7 +7,9 @@
 
 namespace Drupal\views\Plugin\views\field;
 
+use Drupal\Core\Datetime\Date as DateService;
 use Drupal\views\ResultRow;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * A handler to provide proper displays for time intervals.
@@ -18,6 +20,42 @@
  */
 class TimeInterval extends FieldPluginBase {
 
+  /**
+   * The date service.
+   *
+   * @var \Drupal\Core\Datetime\Date
+   */
+  protected $dateService;
+
+  /**
+   * Constructs a TimeInterval plugin object.
+   *
+   * @param array $configuration
+   *   A configuration array containing information about the plugin instance.
+   * @param string $plugin_id
+   *   The plugin_id for the plugin instance.
+   * @param mixed $plugin_definition
+   *   The plugin implementation definition.
+   * @param \Drupal\Core\Datetime\Date $date_service
+   *   The date service.
+   */
+  public function __construct(array $configuration, $plugin_id, $plugin_definition, DateService $date_service) {
+    $this->dateService = $date_service;
+    parent::__construct($configuration, $plugin_id, $plugin_definition);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
+    return new static(
+      $configuration,
+      $plugin_id,
+      $plugin_definition,
+      $container->get('date')
+    );
+  }
+
   protected function defineOptions() {
     $options = parent::defineOptions();
 
@@ -42,7 +80,7 @@ public function buildOptionsForm(&$form, &$form_state) {
    */
   public function render(ResultRow $values) {
     $value = $values->{$this->field_alias};
-    return format_interval($value, isset($this->options['granularity']) ? $this->options['granularity'] : 2);
+    return $this->dateService->formatInterval($value, isset($this->options['granularity']) ? $this->options['granularity'] : 2);
   }
 
 }
diff --git a/core/modules/views/src/Tests/Handler/FieldDateTest.php b/core/modules/views/src/Tests/Handler/FieldDateTest.php
index 503b927..0fe5211 100644
--- a/core/modules/views/src/Tests/Handler/FieldDateTest.php
+++ b/core/modules/views/src/Tests/Handler/FieldDateTest.php
@@ -64,11 +64,11 @@ public function testFieldDate() {
     }
 
     $intervals = array(
-      'raw time ago' => format_interval(REQUEST_TIME - $time, 2),
-      'time ago' => t('%time ago', array('%time' => format_interval(REQUEST_TIME - $time, 2))),
+      'raw time ago' => $this->container->get('date')->formatInterval(REQUEST_TIME - $time, 2),
+      'time ago' => t('%time ago', array('%time' => $this->container->get('date')->formatInterval(REQUEST_TIME - $time, 2))),
       // TODO write tests for them
-//       'raw time span' => format_interval(REQUEST_TIME - $time, 2),
-//       'time span' => t('%time hence', array('%time' => format_interval(REQUEST_TIME - $time, 2))),
+//       'raw time span' => $this->container->get('date')->formatInterval(REQUEST_TIME - $time, 2),
+//       'time span' => t('%time hence', array('%time' => $this->container->get('date')->formatInterval(REQUEST_TIME - $time, 2))),
     );
     $this->assertRenderedDatesEqual($view, $intervals);
   }
diff --git a/core/modules/views_ui/src/ViewEditForm.php b/core/modules/views_ui/src/ViewEditForm.php
index bd276b9..049665a 100644
--- a/core/modules/views_ui/src/ViewEditForm.php
+++ b/core/modules/views_ui/src/ViewEditForm.php
@@ -11,6 +11,7 @@
 use Drupal\Core\Ajax\AjaxResponse;
 use Drupal\Core\Ajax\HtmlCommand;
 use Drupal\Core\Ajax\ReplaceCommand;
+use Drupal\Core\Datetime\Date as DateService;
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Component\Utility\String;
 use Drupal\Core\Render\Element;
@@ -39,14 +40,23 @@ class ViewEditForm extends ViewFormBase {
   protected $requestStack;
 
   /**
+   * The date service.
+   *
+   * @var \Drupal\Core\Datetime\Date
+   */
+  protected $dateService;
+
+  /**
    * Constructs a new ViewEditForm object.
    *
    * @param \Drupal\user\TempStoreFactory $temp_store_factory
    *   The factory for the temp store object.
    * @param \Symfony\Component\HttpFoundation\RequestStack $requestStack
    *   The request stack object.
+   * @param \Drupal\Core\Datetime\Date $date_service
+   *   The date service.
    */
-  public function __construct(TempStoreFactory $temp_store_factory, RequestStack $requestStack) {
+  public function __construct(TempStoreFactory $temp_store_factory, RequestStack $requestStack, DateService $date_service) {
     $this->tempStore = $temp_store_factory->get('views');
     $this->requestStack = $requestStack;
   }
@@ -57,7 +67,8 @@ public function __construct(TempStoreFactory $temp_store_factory, RequestStack $
   public static function create(ContainerInterface $container) {
     return new static(
       $container->get('user.tempstore'),
-      $container->get('request_stack')
+      $container->get('request_stack'),
+      $container->get('date')
     );
   }
 
@@ -125,7 +136,7 @@ public function form(array $form, array &$form_state) {
       );
       $lock_message_substitutions = array(
         '!user' => drupal_render($username),
-        '!age' => format_interval(REQUEST_TIME - $view->lock->updated),
+        '!age' => $this->dateService->formatInterval(REQUEST_TIME - $view->lock->updated),
         '!break' => $view->url('break-lock'),
       );
       $form['locked'] = array(
diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh
index 88ba503..54bef82 100755
--- a/core/scripts/run-tests.sh
+++ b/core/scripts/run-tests.sh
@@ -957,7 +957,7 @@ function simpletest_script_reporter_write_xml_results() {
 function simpletest_script_reporter_timer_stop() {
   echo "\n";
   $end = Timer::stop('run-tests');
-  echo "Test run duration: " . format_interval($end['time'] / 1000);
+  echo "Test run duration: " . \Drupal::service('date')->formatInterval($end['time'] / 1000);
   echo "\n\n";
 }
 
