1.20.x date_sql_handler.inc | date_sql_handler::sql_format($format, $field) |
Helper function to create cross-database SQL date formatting.
Parameters
string $format: A format string for the result, like 'Y-m-d H:i:s' .
string $field: The real table and field name, like 'tablename.fieldname' .
Return value
string: An appropriate SQL string for the db type and field type.
File
- modules/
date/ views/ date_sql_handler.inc, line 203 - SQL helper for Date API.
Class
- date_sql_handler
- A class to manipulate date SQL.
Code
function sql_format($format, $field) {
return $this->db_connection->dateFormatSql($format, $field);
}