WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/18/2009 05:40:40 PM (11 years ago)
Author:
ryan
Message:

Optimize timezone dropdown creation. Props sambauers. fixes #10125 for trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options-general.php

    r11380 r11597  
    158158<br />
    159159<span>
    160 <?php if (get_option('timezone_string')) : ?>
     160<?php if ($tzstring) : ?>
    161161    <?php
    162162    $now = localtime(time(),true);
     
    166166    <br />
    167167    <?php
    168     if (function_exists('timezone_transitions_get') && $tzstring) {
     168    if (function_exists('timezone_transitions_get')) {
    169169        $dateTimeZoneSelected = new DateTimeZone($tzstring);
    170170        foreach (timezone_transitions_get($dateTimeZoneSelected) as $tr) {
    171171            if ($tr['ts'] > time()) {
    172                     $found = true;
     172                $found = true;
    173173                break;
    174174            }
     
    180180                __('Daylight savings time begins on: <code>%s</code>.') :
    181181                __('Standard time begins  on: <code>%s</code>.');
    182             $tz = new DateTimeZone($tzstring);
    183             $d = new DateTime( "@{$tr['ts']}" );
    184             $d->setTimezone($tz);
    185             printf( $message, date_i18n(get_option('date_format').' '.get_option('time_format'), $d->format('U') ) );
     182            printf( $message, date_i18n(get_option('date_format').' '.get_option('time_format'), $tr['ts'] ) );
    186183        } else {
    187184            _e('This timezone does not observe daylight savings time.');
Note: See TracChangeset for help on using the changeset viewer.