You are here

public function SqliteDateSql::setFieldTimezoneOffset in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/query/SqliteDateSql.php \Drupal\views\Plugin\views\query\SqliteDateSql::setFieldTimezoneOffset()
  2. 10 core/modules/views/src/Plugin/views/query/SqliteDateSql.php \Drupal\views\Plugin\views\query\SqliteDateSql::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/SqliteDateSql.php, line 119

Class

SqliteDateSql
SQLite-specific date handling.

Namespace

Drupal\views\Plugin\views\query

Code

public function setFieldTimezoneOffset(&$field, $offset, $string_date = FALSE) {
  if (!empty($offset)) {
    $field = "({$field} + {$offset})";
  }
}