diff --git a/wp-admin/options-general.php b/wp-admin/options-general.php index 0b509a8c2..822849c59 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'); ?>