Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DateSqlInterface.php

function 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);

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal