PHP timezone errors in Drupal

Drupal

I have been struggling somewhat with the problem of annoying timezone errors reported by PHP 5.3.x in the Drupal 6.x logs. In my case, the errors are related to mktime() and date():

mktime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EST/-5.0/no DST' instead in /home/xxxxx/public_html/sites/all/modules/x/x.module on line 158.

Since this was on shared hosting, the only thing that worked was to modify sites/default/settings.php by adding the following:

# --- Timezone setting required by PHP
ini_set('date.timezone','America/Edmonton');

For a list of timezones, see List of Supported Timezones.

This really ought to be handled by Drupal's date/time settings.