You are here

public function DateSqlInterface::getDateFormat in Drupal 8

Same name and namespace in other branches
  1. 9 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);