How can PHP's date function be utilized to convert seconds into a readable time format for database storage?

When storing time durations in a database, it is common to convert seconds into a readable time format for better readability and analysis. PHP's date function can be utilized to achieve this by converting the seconds into a date and time format. This can be done by using the 'Y-m-d H:i:s' format specifier in the date function to convert the seconds into a readable date and time format.

$seconds = 3600; // Example: 1 hour in seconds
$time_format = date('Y-m-d H:i:s', $seconds);
echo $time_format; // Output: 1970-01-01 01:00:00