Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TimeZoneCacheContext.php

function TimeZoneCacheContext::getContext

Overrides CacheContextInterface::getContext

File

core/lib/Drupal/Core/Cache/Context/TimeZoneCacheContext.php, line 26

Class

TimeZoneCacheContext
Defines the TimeZoneCacheContext service, for "per time zone" caching.

Namespace

Drupal\Core\Cache\Context

Code

public function getContext() {
    // date_default_timezone_set() is called in AccountProxy::setAccount(), so
    // we can safely retrieve the timezone.
    return date_default_timezone_get();
}
RSS feed
Powered by Drupal