How does the DATE_FORMAT() function differ in SQL and PHP contexts?

The DATE_FORMAT() function in SQL is used to format dates in a specific way, while in PHP, it is used to format date strings. The syntax and parameters of the function differ between SQL and PHP contexts. In SQL, the function is typically used within a SELECT statement to format date columns, while in PHP, it is used to format date strings for display or manipulation.

// Example of using DATE_FORMAT() function in PHP
$date = "2022-01-15";
$formatted_date = date_format(date_create($date), "Y-m-d H:i:s");
echo $formatted_date;