public function MysqlDateSql::setTimezoneOffset in Drupal 9
Same name and namespace in other branches
- 8 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\queryCode
public function setTimezoneOffset($offset) {
$this->database
->query("SET @@session.time_zone = '{$offset}'");
}