function MysqlDateSql::getDateFormat

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

Overrides DateSqlInterface::getDateFormat

File

core/modules/views/src/Plugin/views/query/MysqlDateSql.php, line 75

Class

MysqlDateSql
MySQL-specific date handling.

Namespace

Drupal\views\Plugin\views\query

Code

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

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