PHP 5.3 and date error

seworthi - October 7, 2009 - 23:13
Project:Backup and Migrate
Version:6.x-1.2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

I installed this module on a new build of 6.14 on PHP 5.3 and received this error:

"warning: date(): 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/Denver' for '-7.0/no DST' instead in C:\inetpub\drupal-6.14\sites\all\modules\backup_migrate\backup_migrate.module on line 479."

I fixed this by adding the following line @ 478:
date_default_timezone_set(variable_get("date_default_timezone_name", 'America/Phoenix'));

This seems to be a PHP 5.3 date() function issue. Please test this fix on a non-production, as I have not done extensive testing to see if this break other things.

#1

seworthi - October 16, 2009 - 23:52
Title:PHP 5.3 and data error» PHP 5.3 and date error

Upon further investigation, the true problem lies in the core and calling the date(). PHP 5.3 throws errors about not having the timezone set. The post http://drupal.org/node/325827, talks about a fix for drupal 7. Hopefully they will rool this patch down into drupal 6.

 
 

Drupal is a registered trademark of Dries Buytaert.