What are common pitfalls to avoid when using PHP's date and time functions in scripts?

One common pitfall when using PHP's date and time functions is not specifying the correct timezone, which can lead to inaccurate date and time calculations. To avoid this issue, always set the timezone using `date_default_timezone_set()` to ensure consistent results across different environments.

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

// Now you can safely use date and time functions
$currentDateTime = date('Y-m-d H:i:s');
echo $currentDateTime;