public function SqlsrvDateSql::setFieldTimezoneOffset in Drupal driver for SQL Server and SQL Azure 8
Same name and namespace in other branches
- 4.2.x src/Plugin/views/query/SqlsrvDateSql.php \Drupal\sqlsrv\Plugin\views\query\SqlsrvDateSql::setFieldTimezoneOffset()
- 3.0.x src/Plugin/views/query/SqlsrvDateSql.php \Drupal\sqlsrv\Plugin\views\query\SqlsrvDateSql::setFieldTimezoneOffset()
- 3.1.x src/Plugin/views/query/SqlsrvDateSql.php \Drupal\sqlsrv\Plugin\views\query\SqlsrvDateSql::setFieldTimezoneOffset()
- 4.0.x src/Plugin/views/query/SqlsrvDateSql.php \Drupal\sqlsrv\Plugin\views\query\SqlsrvDateSql::setFieldTimezoneOffset()
- 4.1.x src/Plugin/views/query/SqlsrvDateSql.php \Drupal\sqlsrv\Plugin\views\query\SqlsrvDateSql::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
- src/
Plugin/ views/ query/ SqlsrvDateSql.php, line 99
Class
- SqlsrvDateSql
- MSSQL-specific date handling.
Namespace
Drupal\sqlsrv\Plugin\views\queryCode
public function setFieldTimezoneOffset(&$field, $offset) {
if (!empty($offset)) {
$field = "DATEADD(second, {$offset}, {$field})";
}
}