function PostgresqlDateSql::getDateFormat

Same name and namespace in other branches
  1. 8.9.x core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php \Drupal\views\Plugin\views\query\PostgresqlDateSql::getDateFormat()
  2. 10 core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php \Drupal\views\Plugin\views\query\PostgresqlDateSql::getDateFormat()
  3. 11.x core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php \Drupal\views\Plugin\views\query\PostgresqlDateSql::getDateFormat()

Overrides DateSqlInterface::getDateFormat

File

core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php, line 77

Class

PostgresqlDateSql
PostgreSQL-specific date handling.

Namespace

Drupal\views\Plugin\views\query

Code

public function getDateFormat($field, $format) {
    $format = strtr($format, static::$replace);
    return "TO_CHAR({$field}, '{$format}')";
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.