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

Breadcrumb

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

function PostgresqlDateSql::getDateField

Overrides DateSqlInterface::getDateField

File

core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php, line 66

Class

PostgresqlDateSql
PostgreSQL-specific date handling.

Namespace

Drupal\views\Plugin\views\query

Code

public function getDateField($field, $string_date) {
    if ($string_date) {
        // Ensures compatibility with field offset operation below.
        return "TO_TIMESTAMP({$field}, 'YYYY-MM-DD\"T\"HH24:MI:SS')";
    }
    return "TO_TIMESTAMP({$field})";
}

API Navigation

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