How can PHP date/time functions be used to format and display date/time information stored in a MySQL database?
When retrieving date/time information from a MySQL database, it is often stored in a specific format (such as 'Y-m-d H:i:s'). To format and display this information using PHP date/time functions, you can use the strtotime() function to convert the database date/time string into a Unix timestamp, and then use the date() function to format the timestamp into the desired display format.
// Retrieve date/time information from MySQL database
$mysqlDateTime = '2022-01-15 14:30:00';
// Convert MySQL date/time string to Unix timestamp
$timestamp = strtotime($mysqlDateTime);
// Format and display date/time information
$formattedDateTime = date('F j, Y g:i a', $timestamp);
echo $formattedDateTime;