I am upgrading one of my websites from 6.20 to 7.0 and when I run the update.php the following error displays before doing the update:

Notice: date_default_timezone_set() [function.date-default-timezone-set]: Timezone ID '3600' is invalid in drupal_session_initialize() (line 262 of /.../includes/session.inc).

My website is in the Brussels timezone.

At the end of the update process, I get the much more friendly following messages:

Some user time zones have been emptied and need to be set to the correct values. Use the new time zone options to choose whether to remind users at login to set the correct time zone.
The default time zone has been set to Europe/London. Check the date and time configuration page to configure it correctly.

I don't think I should be given such a scary notice message at the start.

CommentFileSizeAuthor
#11 fix-timezone-1020748.patch920 bytesxiukun.zhou
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bfroehle’s picture

Component: update.module » base system

Yes, the notice exists because D6 used numeric timezone offsets whereas D7 uses actual timezones. Perhaps we should add a !is_numeric($user->timezone) check in drupal_get_user_timezone()?

drupalshrek’s picture

If it's a known thing which happens, then I would suggest either:
a) to hide the notice message if Drupal upgrade will automatically deal with it
b) if necessary, give a user-friendly message such as:

We notice that since you are using Drupal 6 the timezone offset is listed as numeric. Don't worry, we'll automatically change it for you to use the new super-duper actual timezone which Drupal 7 uses. Now you have a nice day.

My preference is for option (a); if the user doesn't need to know, don't bother him.

mcduarte2000’s picture

Yes, I just got this error and I also got worried... Even because the update process is quite slow and I was starting to think something was wrong...

clashar’s picture

subscribe, got the same message

mstrelan’s picture

+1

drzraf’s picture

+1

drzraf’s picture

Version: 7.0 » 7.x-dev

I would increase the priority. This bug absolutely lock Drupal.
No clear-cache, nothing works.
Even drush vset date_default_timezone Europe/Paris won't bootstrap enough to do the update.
Workaround:
mysql<<<"UPDATE variable SET value = 's:12:\"Europe/Paris\";' WHERE name = 'date_default_timezone'"

drzraf’s picture

But this the tree hiding the forest. I'm still getting a WSOD after a fixed date_default_timezone.

Damien Tournoud’s picture

Title: date_default_timezone_set() Timezone ID '3600' is invalid » Notice during upgrade when the administrator user has a user-timezone set
drzraf’s picture

Status: Needs review » Active

confirmed that it's only a notice (my WSOD is about something different: #1862388: comment.module keeping Drupal from bootstrap)

xiukun.zhou’s picture

Status: Active » Needs review
FileSize
920 bytes
drzraf’s picture

Status: Active » Needs review

patch works for me. no notice anymore

kurund’s picture

patch worked for me. No notice anymore..