diff --git a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
index 6bdd51e..976aac6 100644
--- a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
+++ b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\migrate\Plugin\migrate\id_map;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Field\BaseFieldDefinition;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
@@ -140,6 +141,13 @@ class Sql extends PluginBase implements MigrateIdMapInterface, ContainerFactoryP
   protected $currentKey = [];
 
   /**
+   * The time service.
+   *
+   * @var \Drupal\Component\Datetime\TimeInterface
+   */
+  protected $time;
+
+  /**
    * Constructs an SQL object.
    *
    * Sets up the tables and builds the maps,
@@ -152,11 +160,14 @@ class Sql extends PluginBase implements MigrateIdMapInterface, ContainerFactoryP
    *   The configuration for the plugin.
    * @param \Drupal\migrate\Plugin\MigrationInterface $migration
    *   The migration to do.
+   * @param \Drupal\Component\Datetime\TimeInterface $time
+   *   The time service.
    */
-  public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EventDispatcherInterface $event_dispatcher) {
+  public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EventDispatcherInterface $event_dispatcher, TimeInterface $time) {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->migration = $migration;
     $this->eventDispatcher = $event_dispatcher;
+    $this->time = $time;
     $this->message = new MigrateMessage();
   }
 
@@ -169,7 +180,8 @@ public static function create(ContainerInterface $container, array $configuratio
       $plugin_id,
       $plugin_definition,
       $migration,
-      $container->get('event_dispatcher')
+      $container->get('event_dispatcher'),
+      $container->get('datetime.time')
     );
   }
 
@@ -631,7 +643,7 @@ public function saveIdMapping(Row $row, array $destination_id_values, $source_ro
       return;
     }
     if ($this->migration->getTrackLastImported()) {
-      $fields['last_imported'] = time();
+      $fields['last_imported'] = $this->time->getCurrentTime();
     }
     $keys = [static::SOURCE_IDS_HASH => $this->getSourceIDsHash($source_id_values)];
     // Notify anyone listening of the map row we're about to save.
diff --git a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapEnsureTablesTest.php b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapEnsureTablesTest.php
index 3c3cba8..9acd748 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapEnsureTablesTest.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapEnsureTablesTest.php
@@ -232,7 +232,9 @@ protected function runEnsureTablesTest($schema) {
       ->willReturn($plugin);
     /** @var \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher */
     $event_dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
-    $map = new TestSqlIdMap($database, [], 'sql', [], $migration, $event_dispatcher);
+    /** @var \Drupal\Component\Datetime\TimeInterface */
+    $time = $this->getMock('Drupal\Component\Datetime\TimeInterface');
+    $map = new TestSqlIdMap($database, [], 'sql', [], $migration, $event_dispatcher, $time);
     $map->getDatabase();
   }
 
diff --git a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php
index 2ad2b3d..46abb2f 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php
@@ -111,8 +111,9 @@ protected function getIdMap() {
       ->method('getDestinationPlugin')
       ->willReturn($plugin);
     $event_dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
+    $time = $this->getMock('Drupal\Component\Datetime\TimeInterface');
 
-    $id_map = new TestSqlIdMap($this->database, [], 'sql', [], $migration, $event_dispatcher);
+    $id_map = new TestSqlIdMap($this->database, [], 'sql', [], $migration, $event_dispatcher, $time);
     $migration
       ->method('getIdMap')
       ->willReturn($id_map);
diff --git a/core/modules/migrate/tests/src/Unit/TestSqlIdMap.php b/core/modules/migrate/tests/src/Unit/TestSqlIdMap.php
index 6d33338..6977e9e 100644
--- a/core/modules/migrate/tests/src/Unit/TestSqlIdMap.php
+++ b/core/modules/migrate/tests/src/Unit/TestSqlIdMap.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\migrate\Unit;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Database\Connection;
 use Drupal\migrate\Plugin\MigrationInterface;
 use Drupal\migrate\MigrateException;
@@ -28,10 +29,12 @@ class TestSqlIdMap extends Sql implements \Iterator {
    *   The migration to do.
    * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
    *   The event dispatcher service.
+   * @param \Drupal\Component\Datetime\TimeInterface $time
+   *   The time service.
    */
-  public function __construct(Connection $database, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EventDispatcherInterface $event_dispatcher) {
+  public function __construct(Connection $database, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EventDispatcherInterface $event_dispatcher, TimeInterface $time) {
     $this->database = $database;
-    parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $event_dispatcher);
+    parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $event_dispatcher, $time);
   }
 
   /**
