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

Breadcrumb

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

function MysqlDateSql::getDateField

Overrides DateSqlInterface::getDateField

File

core/modules/views/src/Plugin/views/query/MysqlDateSql.php, line 62

Class

MysqlDateSql
MySQL-specific date handling.

Namespace

Drupal\views\Plugin\views\query

Code

public function getDateField($field, $string_date) {
    if ($string_date) {
        return $field;
    }
    // Base date field storage is timestamp, so the date to be returned here is
    // epoch + stored value (seconds from epoch).
    return "DATE_ADD('19700101', INTERVAL {$field} SECOND)";
}

API Navigation

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