public function MysqlDateSql::setFieldTimezoneOffset 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::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/ MysqlDateSql.php, line 87
Class
- MysqlDateSql
- MySQL-specific date handling.
Namespace
Drupal\views\Plugin\views\queryCode
public function setFieldTimezoneOffset(&$field, $offset) {
if (!empty($offset)) {
$field = "({$field} + INTERVAL {$offset} SECOND)";
}
}