function Drupal::time

Returns the time service.

Return value

\Drupal\Component\Datetime\TimeInterface The time service.

6 calls to Drupal::time()
GarbageCollectionTest::testGarbageCollection in core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php
Tests garbage collection.
MigrateUpgradeImportBatch::onPostRowDelete in core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php
Reacts to item deletion.
MigrateUpgradeImportBatch::onPostRowSave in core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php
Reacts to item import.
TaxonomyTermArgumentDepthTest::setUp in core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTermArgumentDepthTest.php
WorkspaceOperationFactory::__construct in core/modules/workspaces/src/WorkspaceOperationFactory.php

... See full list

File

core/lib/Drupal.php, line 753

Class

Drupal
Static Service Container wrapper.

Code

public static function time() {
  return static::getContainer()->get('datetime.time');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.