function 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 88
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)";
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.