[wp-trac] [WordPress Trac] #20501: Timezone bug in wp-settings.php

WordPress Trac wp-trac at lists.automattic.com
Sat Apr 21 09:53:49 UTC 2012


#20501: Timezone  bug in wp-settings.php
--------------------------+-----------------------------
 Reporter:  j-idris       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Date/Time     |    Version:  3.3.1
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 I am not sure why this logic exists but from the way I see it if the
 default timezone is set, overwrite the setting with "UTC" timezone. It
 doesn't make sense to me because I could have set a date.timezone setting
 in php.ini and I wish to use that setting instead of UTC. After the fix,
 all PHP date() calls return datetime values based on the timezone set in
 php.ini.

 wp-settings.php Line 36
 {{{
 // Set default timezone in PHP 5.
 if ( function_exists( 'date_default_timezone_set' ) )
         date_default_timezone_set( 'UTC' );
 }}}

 My fix:
 {{{
 // Set default timezone in PHP 5.
 if ( !function_exists( 'date_default_timezone_set' ) )
         date_default_timezone_set( 'UTC' );
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20501>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list