[wp-trac] [WordPress Trac] #48858: Incorrect UTC time in WP 5.3

WordPress Trac noreply at wordpress.org
Tue Dec 3 10:28:43 UTC 2019


#48858: Incorrect UTC time in WP 5.3
--------------------------+------------------------------
 Reporter:  balykin95     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Date/Time     |     Version:  5.3
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by balykin95):

 Replying to [comment:4 Rarst]:
 > Could you please check what does `date_default_timezone_get()` returns
 at that point? It **must** be set to `UTC` in WP environment, which core
 does during load.
 >
 > I am not sure why would it be off in clean core environment, but it's
 mostly likely reason for `date()` to be off (if your server clock is
 verified to be correct).

 If i add

 {{{
 echo date("h:i:s ");
 echo date_default_timezone_get();
 die;
 }}}

 before "require_once( dirname( __FILE__ ) . '/admin.php' );" then I get:

 {{{
 10:25:42 Europe/London
 }}}

 If I place it after "require_once( dirname( __FILE__ ) . '/admin.php' );"
 then:

 {{{
 01:26:24 UTC
 }}}



 server time for now:
 {{{
 CT-20662-bash-4.2# timedatectl
       Local time: Tue 2019-12-03 10:26:42 GMT
   Universal time: Tue 2019-12-03 10:26:42 UTC
         RTC time: n/a
        Time zone: Europe/London (GMT, +0000)
      NTP enabled: no
 NTP synchronized: no
  RTC in local TZ: no
       DST active: no
  Last DST change: DST ended at
                   Sun 2019-10-27 01:59:59 BST
                   Sun 2019-10-27 01:00:00 GMT
  Next DST change: DST begins (the clock jumps one hour forward) at
                   Sun 2020-03-29 00:59:59 GMT
                   Sun 2020-03-29 02:00:00 BST
 }}}

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


More information about the wp-trac mailing list