[wp-trac] [WordPress Trac] #36829: Revisions "time ago" not correct when not in GMT

WordPress Trac noreply at wordpress.org
Fri May 13 05:48:39 UTC 2016


#36829: Revisions "time ago" not correct when not in GMT
--------------------------+-----------------------------
 Reporter:  Jassop        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Revisions     |    Version:  4.5.2
 Severity:  normal        |   Keywords:
  Focuses:  ui            |
--------------------------+-----------------------------
 Hi,

 The revisions section of the page edit section says I last edited a page:

 8 hours ago (May 13, 2016 @ 13:28:09)

 However that is only a couple of minutes ago. The date displayed is the
 correct date and time according to the server settings (Perth, Australia)
 but the "time ago" is the offset to GMT rather than a couple of minutes.

 I had a quick look at the function  wp_prepare_revisions_for_js in
 wp-admin/includes/revision.php, and it contains the line:

 {{{#!php
 <?php
 $now_gmt = time();
 }}}

 According to [http://php.net/manual/en/function.time.php] this is timezone
 independent. I ''think'' that might be the problem, but I've only been
 doing PHP for a few months so thought I would let someone else say what
 the correct fix should be!

 Thanks.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36829>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list