You are here

public function MysqlDateSql::setTimezoneOffset in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/query/MysqlDateSql.php \Drupal\views\Plugin\views\query\MysqlDateSql::setTimezoneOffset()
  2. 10 core/modules/views/src/Plugin/views/query/MysqlDateSql.php \Drupal\views\Plugin\views\query\MysqlDateSql::setTimezoneOffset()

Set the database to the given timezone.

Parameters

string $offset: The timezone.

Overrides DateSqlInterface::setTimezoneOffset

File

core/modules/views/src/Plugin/views/query/MysqlDateSql.php, line 80

Class

MysqlDateSql
MySQL-specific date handling.

Namespace

Drupal\views\Plugin\views\query

Code

public function setTimezoneOffset($offset) {
  $this->database
    ->query("SET @@session.time_zone = '{$offset}'");
}