How does PHP handle time zones and daylight saving time changes?

PHP handles time zones and daylight saving time changes by allowing developers to set the default time zone using the `date_default_timezone_set()` function and by using the `DateTime` class which takes time zones into account when working with dates and times. Additionally, PHP provides functions like `date()` and `strtotime()` that can handle time zone conversions and daylight saving time adjustments.

// Set the default time zone to UTC
date_default_timezone_set('UTC');

// Create a new DateTime object with the desired time zone
$date = new DateTime('now', new DateTimeZone('America/New_York'));

// Format the date in the desired format
echo $date->format('Y-m-d H:i:s');