function DateSqlInterface::getDateFormat

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

Creates a native database date formatting.

Parameters

string $field: An appropriate query expression pointing to the date field.

string $format: A format string for the result. For example: 'Y-m-d H:i:s'.

Return value

string A string representing the field formatted as a date as specified by $format.

3 methods override DateSqlInterface::getDateFormat()
MysqlDateSql::getDateFormat in core/modules/views/src/Plugin/views/query/MysqlDateSql.php
Creates a native database date formatting.
PostgresqlDateSql::getDateFormat in core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php
Creates a native database date formatting.
SqliteDateSql::getDateFormat in core/modules/views/src/Plugin/views/query/SqliteDateSql.php
Creates a native database date formatting.

File

core/modules/views/src/Plugin/views/query/DateSqlInterface.php, line 42

Class

DateSqlInterface
Defines an interface for handling date queries with SQL.

Namespace

Drupal\views\Plugin\views\query

Code

public function getDateFormat($field, $format);

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