From 9d7ec14d5b39ac37f2f8e98daa80c9aed43d0992 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 15 Mar 2010 01:57:36 +0000 Subject: [PATCH] Fix DST/Standard transition display. git-svn-id: https://develop.svn.wordpress.org/trunk@13702 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/options-general.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/wp-admin/options-general.php b/wp-admin/options-general.php index 0b509a8c25..822849c592 100644 --- a/wp-admin/options-general.php +++ b/wp-admin/options-general.php @@ -191,6 +191,8 @@ if ( empty($tzstring) ) { // Create a UTC+- zone if no timezone string exists
time() ) { + if ( $tr['ts'] > $right_now ) { $found = true; break; } @@ -214,11 +218,14 @@ if ( empty($tzstring) ) { // Create a UTC+- zone if no timezone string exists $message = $tr['isdst'] ? __('Daylight saving time begins on: %s.') : __('Standard time begins on: %s.'); - printf( $message, date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $tr['ts'] ) ); + // Add the difference between the current offset and the new offset to ts to get the correct transition time from date_i18n(). + printf( $message, date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $tr['ts'] + ($tz_offset - $tr['offset']) ) ); } else { _e('This timezone does not observe daylight saving time.'); } } + // Set back to UTC. + date_default_timezone_set('UTC'); ?>