Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#36829 closed defect (bug) (duplicate)

Revisions "time ago" not correct when not in GMT

Reported by: jassop's profile Jassop Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.5.2
Component: Revisions Keywords:
Focuses: ui Cc:

Description

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
$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.

Change History (1)

#1 @adamsilverstein
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

@Jassop Thanks for the bug report. This issue is already covered in #25365; please see the discussion and potential solution there; I will bring this issue up to the lead devs again soon to see if its something they want to change.

Note: See TracTickets for help on using tickets.