[wp-trac] [WordPress Trac] #39595: date_default_timezone_set in wp-settings.php is set prematurely and ignorantly, regardless of other defined settings

WordPress Trac noreply at wordpress.org
Tue Mar 27 11:45:42 UTC 2018


#39595: date_default_timezone_set in wp-settings.php is set prematurely and
ignorantly, regardless of other defined settings
-------------------------------+------------------------------
 Reporter:  mkormendy          |       Owner:
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Date/Time          |     Version:  4.7.1
 Severity:  minor              |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by romulodl):

 Another British Summer Time arrived and again I have the same issue. Just
 realised that wordpress forces `UTC` times and ignore time changes. Is
 there any workaround for this issue?

 {{{#!bash
 $ vendor/bin/wp shell
 wp> new DateTime
 => object(DateTime)#3368 (3) {
   ["date"]=>
   string(26) "2018-03-27 11:19:44.396909"
   ["timezone_type"]=>
   int(3)
   ["timezone"]=>
   string(3) "UTC"

 wp> date_default_timezone_set('Europe/London');
 => bool(true)

 wp> new DateTime()
 => object(DateTime)#3368 (3) {
   ["date"]=>
   string(26) "2018-03-27 12:20:31.151286"
   ["timezone_type"]=>
   int(3)
   ["timezone"]=>
   string(13) "Europe/London"
 }}}

 my `php.ini` file is set to `Europe/London`
 I am running Wordpress 4.9.4

 Is there any plans to change this behaviour? If so, I could have a look at
 it...

 Thanks

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39595#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list