What are the potential pitfalls of using strtotime function in PHP for time addition?

Using strtotime for time addition in PHP can lead to unexpected results when adding time intervals that cross over daylight saving time changes or when working with time zones. To avoid these pitfalls, it's recommended to use DateTime objects along with DateInterval for accurate time calculations.

$datetime = new DateTime('2022-01-01 12:00:00');
$interval = new DateInterval('PT1H'); // 1 hour interval
$datetime->add($interval);

echo $datetime->format('Y-m-d H:i:s'); // Output: 2022-01-01 13:00:00