function MysqlDateSql::getDateField
Same name in other branches
- 9 core/modules/views/src/Plugin/views/query/MysqlDateSql.php \Drupal\views\Plugin\views\query\MysqlDateSql::getDateField()
- 8.9.x core/modules/views/src/Plugin/views/query/MysqlDateSql.php \Drupal\views\Plugin\views\query\MysqlDateSql::getDateField()
- 10 core/modules/views/src/Plugin/views/query/MysqlDateSql.php \Drupal\views\Plugin\views\query\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\queryCode
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)";
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.