? sites/default/files
? sites/default/settings.php
Index: CHANGELOG.txt
===================================================================
RCS file: /cvs/drupal/drupal/CHANGELOG.txt,v
retrieving revision 1.315
diff -u -p -r1.315 CHANGELOG.txt
--- CHANGELOG.txt	12 Jun 2009 13:59:56 -0000	1.315
+++ CHANGELOG.txt	24 Jun 2009 08:25:37 -0000
@@ -73,6 +73,8 @@ Drupal 7.0, xxxx-xx-xx (development vers
     * If your site is being upgraded from Drupal 6 and you do not have the
       contributed date or event modules installed, user time zone settings will
       fallback to the system time zone and will have to be reconfigured by each user.
+    * User-configured time zones now serve as the default time zone for PHP
+      date/time functions.
 - Removed ping module:
     * Contributed modules with similar functionality are available.
 - Refactored the "access rules" component of user module:
Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.287
diff -u -p -r1.287 bootstrap.inc
--- includes/bootstrap.inc	10 Jun 2009 20:00:10 -0000	1.287
+++ includes/bootstrap.inc	24 Jun 2009 08:25:38 -0000
@@ -1366,6 +1366,7 @@ function _drupal_bootstrap($phase) {
     case DRUPAL_BOOTSTRAP_VARIABLES:
       // Initialize configuration variables, using values from settings.php if available.
       $conf = variable_init(isset($conf) ? $conf : array());
+      date_default_timezone_set(drupal_get_user_timezone());
       break;
 
     case DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE:
@@ -1427,6 +1428,21 @@ function _drupal_bootstrap($phase) {
 }
 
 /**
+ * Return the time zone of the current user.
+ */
+function drupal_get_user_timezone() {
+  global $user;
+  if (variable_get('configurable_timezones', 1) && $user->uid && $user->timezone) {
+    return $user->timezone;
+  }
+  else {
+    // Ignore PHP strict notice if time zone has not yet been set in the php.ini
+    // configuration.
+    return variable_get('date_default_timezone', @date_default_timezone_get());
+  }
+}
+
+/**
  * Enables use of the theme system without requiring database access.
  *
  * Loads and initializes the theme system for site installs, updates and when
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.925
diff -u -p -r1.925 common.inc
--- includes/common.inc	18 Jun 2009 21:19:01 -0000	1.925
+++ includes/common.inc	24 Jun 2009 08:25:38 -0000
@@ -1880,13 +1880,7 @@ function format_interval($timestamp, $gr
 function format_date($timestamp, $type = 'medium', $format = '', $timezone = NULL, $langcode = NULL) {
   $timezones = &drupal_static(__FUNCTION__, array());
   if (!isset($timezone)) {
-    global $user;
-    if (variable_get('configurable_timezones', 1) && $user->uid && $user->timezone) {
-      $timezone = $user->timezone;
-    }
-    else {
-      $timezone = variable_get('date_default_timezone', 'UTC');
-    }
+    $timezone = date_default_timezone_get();
   }
   // Store DateTimeZone objects in an array rather than repeatedly
   // contructing identical objects over the life of a request.
Index: includes/session.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/session.inc,v
retrieving revision 1.69
diff -u -p -r1.69 session.inc
--- includes/session.inc	2 Jun 2009 06:58:15 -0000	1.69
+++ includes/session.inc	24 Jun 2009 08:25:38 -0000
@@ -269,6 +269,7 @@ function drupal_session_regenerate() {
       ->condition('sid', $old_session_id)
       ->execute();
   }
+  date_default_timezone_set(drupal_get_user_timezone());
 }
 
 /**
Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.117
diff -u -p -r1.117 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	16 Jun 2009 04:43:47 -0000	1.117
+++ modules/simpletest/drupal_web_test_case.php	24 Jun 2009 08:25:39 -0000
@@ -1030,6 +1030,7 @@ class DrupalWebTestCase extends DrupalTe
     variable_set('install_task', 'profile-finished');
     variable_set('clean_url', $clean_url_original);
     variable_set('site_mail', 'simpletest@example.com');
+    variable_set('date_default_timezone', date_default_timezone_get());
     // Set up English language.
     unset($GLOBALS['conf']['language_default']);
     $language = language_default();
