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

Breadcrumb

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

function HandlerBase::getDateFormat

Creates cross-database SQL date formatting.

Parameters

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

Return value

string An appropriate SQL string for the DB type and field type.

2 calls to HandlerBase::getDateFormat()
Date::getFormula in core/modules/views/src/Plugin/views/argument/Date.php
Date::query in core/modules/views/src/Plugin/views/sort/Date.php
Called to add the sort to a query.
2 methods override HandlerBase::getDateFormat()
Date::getDateFormat in core/modules/datetime/src/Plugin/views/sort/Date.php
Overridden in order to pass in the string date flag.
Date::getDateFormat in core/modules/datetime/src/Plugin/views/argument/Date.php
Creates cross-database SQL date formatting.

File

core/modules/views/src/Plugin/views/HandlerBase.php, line 721

Class

HandlerBase
Base class for Views handler plugins.

Namespace

Drupal\views\Plugin\views

Code

public function getDateFormat($format) {
    return $this->query
        ->getDateFormat($this->getDateField(), $format);
}

API Navigation

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