How can the date() function be utilized to display both the date and time components of a timestamp in PHP?

To display both the date and time components of a timestamp in PHP, you can use the date() function with the 'Y-m-d H:i:s' format parameter. This format will display the year, month, day, hour, minute, and second of the timestamp.

$timestamp = time();
$date_time = date('Y-m-d H:i:s', $timestamp);
echo $date_time;