Make WordPress Core

Ticket #46483: settings-dst-detection.patch

File settings-dst-detection.patch, 973 bytes (added by Rarst, 6 years ago)
  • src/wp-admin/options-general.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    252252<p class="timezone-info">
    253253<span>
    254254        <?php
    255         // Set TZ so localtime works.
    256         date_default_timezone_set( $tzstring );
    257         $now = localtime( time(), true );
    258         if ( $now['tm_isdst'] ) {
     255        $now = new DateTime( 'now', new DateTimeZone( $tzstring ) );
     256        $dst = (bool) $now->format( 'I' );
     257
     258        if ( $dst ) {
    259259                _e( 'This timezone is currently in daylight saving time.' );
    260260        } else {
    261261                _e( 'This timezone is currently in standard time.' );
     
    296296                        _e( 'This timezone does not observe daylight saving time.' );
    297297                }
    298298        }
    299         // Set back to UTC.
    300         date_default_timezone_set( 'UTC' );
    301299        ?>
    302300        </span>
    303301</p>