diff --git a/src/Boot/DrupalBoot8.php b/src/Boot/DrupalBoot8.php index 85b8bcb552..0c610eaf2c 100644 --- a/src/Boot/DrupalBoot8.php +++ b/src/Boot/DrupalBoot8.php @@ -7,6 +7,7 @@ use Drupal\Core\Database\Database; use Drupal\Core\Render\HtmlResponse; use Drupal\Core\DrupalKernel; +use Drupal\Core\Session\AnonymousUserSession; use Drush\Config\ConfigLocator; use Drush\Drupal\DrushLoggerServiceProvider; use Drush\Drupal\DrushServiceModifier; @@ -248,6 +249,9 @@ public function bootstrapDrupalFull(BootstrapManager $manager): void parent::bootstrapDrupalFull($manager); $this->addDrupalModuleDrushCommands($manager); + + // Set a default account to make sure the correct timezone is set + $this->kernel->getContainer()->get('current_user')->setAccount(new AnonymousUserSession()); } public function addDrupalModuleDrushCommands($manager): void