public function PostgresqlDateSql::setFieldTimezoneOffset in Drupal 10
Same name and namespace in other branches
- 8 core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php \Drupal\views\Plugin\views\query\PostgresqlDateSql::setFieldTimezoneOffset()
- 9 core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php \Drupal\views\Plugin\views\query\PostgresqlDateSql::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/ PostgresqlDateSql.php, line 85
Class
- PostgresqlDateSql
- PostgreSQL-specific date handling.
Namespace
Drupal\views\Plugin\views\queryCode
public function setFieldTimezoneOffset(&$field, $offset) {
$field = "({$field} + INTERVAL '{$offset} SECONDS')";
}