What are some best practices for handling time calculations in PHP to avoid issues with daylight saving time changes?

When handling time calculations in PHP, it is important to use timezone-aware functions and avoid relying solely on functions like `strtotime` or `date`. To avoid issues with daylight saving time changes, always store and manipulate timestamps in UTC and only convert to local time for display purposes.

// Set default timezone to UTC
date_default_timezone_set('UTC');

// Get current timestamp in UTC
$currentTimeUTC = time();

// Convert UTC timestamp to local time for display
$localTimezone = new DateTimeZone('America/New_York');
$localTime = new DateTime('@' . $currentTimeUTC);
$localTime->setTimezone($localTimezone);

echo $localTime->format('Y-m-d H:i:s');