Index: wp-includes/post-template.php
===================================================================
--- wp-includes/post-template.php	(revision 12598)
+++ wp-includes/post-template.php	(working copy)
@@ -1210,7 +1210,7 @@
 	/* translators: 1: date */
 	$currentf  = __( '%1$s [Current Revision]' );
 
-	$date = date_i18n( $datef, strtotime( $revision->post_modified_gmt . ' +0000' ) );
+	$date = date_i18n( $datef, strtotime( $revision->post_modified ) );
 	if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) )
 		$date = "<a href='$link'>$date</a>";
 
Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 12597)
+++ wp-includes/post.php	(working copy)
@@ -1974,7 +1974,7 @@
 
 	$time = strtotime( $post->post_date_gmt . ' GMT' );
 
-	if ( $time > time() ) { // Uh oh, someone jumped the gun!
+	if ( $time > current_time('timestamp', true) ) { // Uh oh, someone jumped the gun!
 		wp_clear_scheduled_hook( 'publish_future_post', array( $post_id ) ); // clear anything else in the system
 		wp_schedule_single_event( $time, 'publish_future_post', array( $post_id ) );
 		return;
Index: wp-includes/functions.php
===================================================================
--- wp-includes/functions.php	(revision 12596)
+++ wp-includes/functions.php	(working copy)
@@ -59,13 +59,26 @@
  * @return int|string String if $type is 'gmt', int if $type is 'timestamp'.
  */
 function current_time( $type, $gmt = 0 ) {
-	switch ( $type ) {
-		case 'mysql':
-			return ( $gmt ) ? gmdate( 'Y-m-d H:i:s' ) : gmdate( 'Y-m-d H:i:s', ( time() + ( get_option( 'gmt_offset' ) * 3600 ) ) );
-			break;
-		case 'timestamp':
-			return ( $gmt ) ? time() : time() + ( get_option( 'gmt_offset' ) * 3600 );
-			break;
+	if ( function_exists('date_default_timezone_set') && '' != get_option('timezone_string') ) {
+		// Use the PHP5 DateTime support. The timezone is already correctly set.
+		switch ( $type ) {
+			case 'mysql':
+				return ( $gmt ) ? gmdate( 'Y-m-d H:i:s' ) : date( 'Y-m-d H:i:s' );
+				break;
+			case 'timestamp':
+				return ( $gmt ) ? gmdate('U') : time();
+				break;
+		}
+	} else {
+		// No PHP5 DateTime support or timezone not set. Add in gmt_offset.
+		switch ( $type ) {
+			case 'mysql':
+				return ( $gmt ) ? gmdate( 'Y-m-d H:i:s') : gmdate( 'Y-m-d H:i:s', ( time() + ( get_option( 'gmt_offset' ) * 3600 ) ) );
+				break;
+			case 'timestamp':
+				return ( $gmt ) ? time() : ( time() + ( get_option( 'gmt_offset' ) * 3600 ) );
+				break;
+		}
 	}
 }
 
@@ -88,20 +101,18 @@
 	$i = $unixtimestamp;
 	// Sanity check for PHP 5.1.0-
 	if ( false === $i || intval($i) < 0 ) {
-		if ( ! $gmt )
-			$i = current_time( 'timestamp' );
-		else
-			$i = time();
+		$i = current_time( 'timestamp', $gmt );
 		// we should not let date() interfere with our
 		// specially computed timestamp
-		$gmt = true;
+		if ( !function_exists('date_default_timezone_set') )
+			$gmt = true;
 	}
 
 	// store original value for language with untypical grammars
 	// see http://core.trac.wordpress.org/ticket/9396
 	$req_format = $dateformatstring;
 
-	$datefunc = $gmt? 'gmdate' : 'date';
+	$datefunc = $gmt ? 'gmdate' : 'date';
 
 	if ( ( !empty( $wp_locale->month ) ) && ( !empty( $wp_locale->weekday ) ) ) {
 		$datemonth = $wp_locale->get_month( $datefunc( 'm', $i ) );
@@ -127,6 +138,22 @@
 }
 
 /**
+ * WP wrapper for date() that hides differences between PHP4 and PHP 5 date and time support.
+ *
+ * @since 3.0
+ *
+ * @param string $format Format to display the date.
+ * @param int $timestamp Optional. Unix timestamp.
+ * @return string The formatted date
+ */
+function compat_date($format, $timestamp = false) {
+	if ( function_exists('date_default_timezone_set') )
+		return date($format, $timestamp);
+	else
+		return gmdate($format, $timestamp);
+}
+
+/**
  * Convert number to format based on the locale.
  *
  * @since 2.3.0
Index: wp-settings.php
===================================================================
--- wp-settings.php	(revision 12596)
+++ wp-settings.php	(working copy)
@@ -18,9 +18,6 @@
 set_magic_quotes_runtime(0);
 @ini_set('magic_quotes_sybase', 0);
 
-if ( function_exists('date_default_timezone_set') )
-	date_default_timezone_set('UTC');
-
 /**
  * Turn register globals off.
  *
@@ -719,6 +716,14 @@
 // Load in support for template functions which the theme supports
 require_if_theme_supports( 'post-thumbnails', ABSPATH . WPINC . '/post-thumbnail-template.php' );
 
+// Set the timezone
+if ( function_exists('date_default_timezone_set') ) {
+	if ( $timezone_string = get_option( 'timezone_string' ) )
+		@date_default_timezone_set( $timezone_string );
+	else
+		@date_default_timezone_set('UTC');
+}
+
 /**
  * Runs just before PHP shuts down execution.
  *
Index: wp-admin/includes/meta-boxes.php
===================================================================
--- wp-admin/includes/meta-boxes.php	(revision 12597)
+++ wp-admin/includes/meta-boxes.php	(working copy)
@@ -165,7 +165,7 @@
 	$date = date_i18n( $datef, strtotime( $post->post_date ) );
 } else { // draft (no saves, and thus no date specified)
 	$stamp = __('Publish <b>immediately</b>');
-	$date = date_i18n( $datef, strtotime( current_time('mysql') ) );
+	$date = date_i18n( $datef, current_time('timestamp') );
 }
 
 if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
Index: wp-admin/includes/template.php
===================================================================
--- wp-admin/includes/template.php	(revision 12597)
+++ wp-admin/includes/template.php	(working copy)
@@ -1408,7 +1408,7 @@
 				$m_time = $post->post_date;
 				$time = get_post_time('G', true, $post);
 
-				$time_diff = time() - $time;
+				$time_diff = current_time('timestamp', true) - $time;
 
 				if ( $time_diff > 0 && $time_diff < 24*60*60 )
 					$h_time = sprintf( __('%s ago'), human_time_diff( $time ) );
@@ -1635,7 +1635,7 @@
 			$m_time = $page->post_date;
 			$time = get_post_time('G', true);
 
-			$time_diff = time() - $time;
+			$time_diff = current_time('timestamp', true) - $time;
 
 			if ( $time_diff > 0 && $time_diff < 24*60*60 )
 				$h_time = sprintf( __('%s ago'), human_time_diff( $time ) );
@@ -2105,7 +2105,7 @@
 		$author_url_display = substr($author_url_display, 0, 49) . '...';
 
 	$ptime = date('G', strtotime( $comment->comment_date ) );
-	if ( ( abs(time() - $ptime) ) < 86400 )
+	if ( ( abs(current_time('timestamp') - $ptime) ) < 86400 )
 		$ptime = sprintf( __('%s ago'), human_time_diff( $ptime ) );
 	else
 		$ptime = mysql2date(__('Y/m/d \a\t g:i A'), $comment->comment_date );
@@ -2612,18 +2612,18 @@
 
 	$time_adj = current_time('timestamp');
 	$post_date = ($for_post) ? $post->post_date : $comment->comment_date;
-	$jj = ($edit) ? mysql2date( 'd', $post_date, false ) : gmdate( 'd', $time_adj );
-	$mm = ($edit) ? mysql2date( 'm', $post_date, false ) : gmdate( 'm', $time_adj );
-	$aa = ($edit) ? mysql2date( 'Y', $post_date, false ) : gmdate( 'Y', $time_adj );
-	$hh = ($edit) ? mysql2date( 'H', $post_date, false ) : gmdate( 'H', $time_adj );
-	$mn = ($edit) ? mysql2date( 'i', $post_date, false ) : gmdate( 'i', $time_adj );
-	$ss = ($edit) ? mysql2date( 's', $post_date, false ) : gmdate( 's', $time_adj );
+	$jj = ($edit) ? mysql2date( 'd', $post_date, false ) : compat_date( 'd', $time_adj );
+	$mm = ($edit) ? mysql2date( 'm', $post_date, false ) : compat_date( 'm', $time_adj );
+	$aa = ($edit) ? mysql2date( 'Y', $post_date, false ) : compat_date( 'Y', $time_adj );
+	$hh = ($edit) ? mysql2date( 'H', $post_date, false ) : compat_date( 'H', $time_adj );
+	$mn = ($edit) ? mysql2date( 'i', $post_date, false ) : compat_date( 'i', $time_adj );
+	$ss = ($edit) ? mysql2date( 's', $post_date, false ) : compat_date( 's', $time_adj );
 
-	$cur_jj = gmdate( 'd', $time_adj );
-	$cur_mm = gmdate( 'm', $time_adj );
-	$cur_aa = gmdate( 'Y', $time_adj );
-	$cur_hh = gmdate( 'H', $time_adj );
-	$cur_mn = gmdate( 'i', $time_adj );
+	$cur_jj = compat_date( 'd', $time_adj );
+	$cur_mm = compat_date( 'm', $time_adj );
+	$cur_aa = compat_date( 'Y', $time_adj );
+	$cur_hh = compat_date( 'H', $time_adj );
+	$cur_mn = compat_date( 'i', $time_adj );
 
 	$month = "<select " . ( $multi ? '' : 'id="mm" ' ) . "name=\"mm\"$tab_index_attribute>\n";
 	for ( $i = 1; $i < 13; $i = $i +1 ) {
Index: wp-admin/upload.php
===================================================================
--- wp-admin/upload.php	(revision 12596)
+++ wp-admin/upload.php	(working copy)
@@ -417,7 +417,7 @@
 			$t_time = get_the_time(__('Y/m/d g:i:s A'));
 			$m_time = $post->post_date;
 			$time = get_post_time( 'G', true );
-			if ( ( abs($t_diff = time() - $time) ) < 86400 ) {
+			if ( ( abs($t_diff = current_time('timestamp', true) - $time) ) < 86400 ) {
 				if ( $t_diff < 0 )
 					$h_time = sprintf( __('%s from now'), human_time_diff( $time ) );
 				else
