What are some best practices for handling UNIX timestamps in PHP to avoid incorrect date conversions?

When working with UNIX timestamps in PHP, it's important to ensure that the timestamps are interpreted correctly based on the timezone. To avoid incorrect date conversions, it's recommended to set the default timezone explicitly using the `date_default_timezone_set()` function before working with timestamps.

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

// Example UNIX timestamp
$timestamp = 1609459200;

// Convert UNIX timestamp to a formatted date
$date = date('Y-m-d H:i:s', $timestamp);

echo $date;