function MysqlDateSql::setFieldTimezoneOffset

Same name in other branches
  1. 8.9.x core/modules/views/src/Plugin/views/query/MysqlDateSql.php \Drupal\views\Plugin\views\query\MysqlDateSql::setFieldTimezoneOffset()
  2. 10 core/modules/views/src/Plugin/views/query/MysqlDateSql.php \Drupal\views\Plugin\views\query\MysqlDateSql::setFieldTimezoneOffset()
  3. 11.x core/modules/views/src/Plugin/views/query/MysqlDateSql.php \Drupal\views\Plugin\views\query\MysqlDateSql::setFieldTimezoneOffset()

Overrides DateSqlInterface::setFieldTimezoneOffset

File

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

Class

MysqlDateSql
MySQL-specific date handling.

Namespace

Drupal\views\Plugin\views\query

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.