diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2004-08-10 01:30:09 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2004-08-10 01:30:09 +0000 |
commit | 88221c2f6751bc983a268cf21d5ddf39e8be515d (patch) | |
tree | 217883593ba7e6a6aad753de4d237f5669990d69 | |
parent | d6a91bddcf30884441667fe87936e7b34769c713 (diff) | |
download | brdo-88221c2f6751bc983a268cf21d5ddf39e8be515d.tar.gz brdo-88221c2f6751bc983a268cf21d5ddf39e8be515d.tar.bz2 |
#7646 and more:
- Users who have not edited their account yet would be reset to GMT rather than the sitewide timezone.
- Users who chose GMT (zero timezone) on a site with a non-zero timezone as default would have incorrect timezone.
-rw-r--r-- | includes/common.inc | 7 | ||||
-rw-r--r-- | modules/system.module | 2 | ||||
-rw-r--r-- | modules/system/system.module | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/includes/common.inc b/includes/common.inc index 2f5df9e48..feab010d2 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -915,7 +915,12 @@ function format_interval($timestamp, $granularity = 2) { function format_date($timestamp, $type = 'medium', $format = '', $timezone = NULL) { if ($timezone === NULL) { global $user; - $timezone = $user->uid ? $user->timezone : variable_get('date_default_timezone', 0); + if (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) { + $timezone = $user->timezone; + } + else { + $timezone = variable_get('date_default_timezone', 0); + } } $timestamp += $timezone; diff --git a/modules/system.module b/modules/system.module index 10199e075..1fa3e93e5 100644 --- a/modules/system.module +++ b/modules/system.module @@ -106,7 +106,7 @@ function system_user($type, $edit, &$user, $category = NULL) { if (variable_get('configurable_timezones', 1)) { $zones = _system_zonelist(); - $data[] = array('title' => t('Locale settings'), 'data' => form_select(t('Time zone'), 'timezone', isset($edit['timezone']) ? $edit['timezone'] : variable_get('date_default_timezone', 0), $zones, t('Select your current local time. Dates and times throughout this site will be displayed using this time zone.')), 'weight' => 2); + $data[] = array('title' => t('Locale settings'), 'data' => form_select(t('Time zone'), 'timezone', strlen($edit['timezone']) ? $edit['timezone'] : variable_get('date_default_timezone', 0), $zones, t('Select your current local time. Dates and times throughout this site will be displayed using this time zone.')), 'weight' => 2); } return $data; } diff --git a/modules/system/system.module b/modules/system/system.module index 10199e075..1fa3e93e5 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -106,7 +106,7 @@ function system_user($type, $edit, &$user, $category = NULL) { if (variable_get('configurable_timezones', 1)) { $zones = _system_zonelist(); - $data[] = array('title' => t('Locale settings'), 'data' => form_select(t('Time zone'), 'timezone', isset($edit['timezone']) ? $edit['timezone'] : variable_get('date_default_timezone', 0), $zones, t('Select your current local time. Dates and times throughout this site will be displayed using this time zone.')), 'weight' => 2); + $data[] = array('title' => t('Locale settings'), 'data' => form_select(t('Time zone'), 'timezone', strlen($edit['timezone']) ? $edit['timezone'] : variable_get('date_default_timezone', 0), $zones, t('Select your current local time. Dates and times throughout this site will be displayed using this time zone.')), 'weight' => 2); } return $data; } |