What potential issues can arise when using mktime() in PHP to handle dates and times?

One potential issue when using mktime() in PHP is that it may not handle daylight saving time changes correctly. To solve this issue, it is recommended to use the DateTime class in PHP, which provides better support for timezones and daylight saving time adjustments.

// Using DateTime class to handle dates and times with correct timezone support
$date = new DateTime();
$date->setTimezone(new DateTimeZone('America/New_York'));
echo $date->format('Y-m-d H:i:s');