You are here

public function PostgresqlDateSql::setFieldTimezoneOffset 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::setFieldTimezoneOffset()

Applies the given offset to the given field.

Parameters

string &$field: The date field in a string format.

int $offset: The timezone offset in seconds.

Overrides DateSqlInterface::setFieldTimezoneOffset

File

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

Class

PostgresqlDateSql
PostgreSQL-specific date handling.

Namespace

Drupal\views\Plugin\views\query

Code

public function setFieldTimezoneOffset(&$field, $offset) {
  $field = "({$field} + INTERVAL '{$offset} SECONDS')";
}