What best practices should be followed when creating a PHP calendar to avoid errors like the one experienced in October 2005?

The issue in October 2005 was due to a bug in PHP's `strtotime` function that caused incorrect date calculations when handling dates near the end of daylight saving time. To avoid similar errors, it is recommended to use the `DateTime` class in PHP for accurate date and time calculations.

// Create a new DateTime object with the current date
$today = new DateTime();

// Add 1 day to the current date
$today->modify('+1 day');

// Format the date in 'Y-m-d' format
echo $today->format('Y-m-d');