Get this error when trying to login: Notice: date_default_timezone_set() [function.date-default-timezone-set]: Timezone ID '-18000' is invalid in drupal_session_regenerate

Traced to line 122 in user.inc within the user import "supported" folder:

$account_add['timezone'] = '-18000';

Changed it to a real timezone string and it worked as shown below. This will need to become a lookup to get the current or default Drupal timezone, but was a quick fix for my use case.

$account_add['timezone'] = 'America/Chicago';
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

R3ason’s picture

leanderl’s picture

I can confirm this bug and that the fix solves the problem. (Using user_import 7.x-2.1 and Drupal 7.25).
Really nice module, keep up the good work!

KevinVb’s picture

Version: 7.x-1.0-beta5 » 7.x-1.1
Status: Active » Needs review
FileSize
603 bytes

I'm updating this module to version 1.1. and the same issue is still present.
So i patched it with the use of the default timezone of the website, if that isn't found i use the Europe/Brussels timezone because that's my timezone, but normally when you install Drupal you will always have a default timezone as a variable set in your system except when you wrote code that deletes it. But who does that?

gisle’s picture

Version: 7.x-1.1 » 7.x-3.2
Status: Needs review » Closed (outdated)

This seems to ficed in the latest stable release:

$account_add['timezone'] = variable_get('date_default_timezone', @date_default_timezone_get());