You are here

public function PostgresqlDateSql::setTimezoneOffset in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php \Drupal\views\Plugin\views\query\PostgresqlDateSql::setTimezoneOffset()

Set the database to the given timezone.

Parameters

string $offset: The timezone.

Overrides DateSqlInterface::setTimezoneOffset

File

core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php, line 92

Class

PostgresqlDateSql
PostgreSQL-specific date handling.

Namespace

Drupal\views\Plugin\views\query

Code

public function setTimezoneOffset($offset) {
  $this->database
    ->query("SET TIME ZONE INTERVAL '{$offset}' HOUR TO MINUTE");
}