Skip to:

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#692 closed defect (bug) (fixed)

bp_core_time_since returns '-1 years, 12 months' for future date

Reported by: lilyfan's profile lilyfan Owned by:
Milestone: Priority: major
Severity: Version: 1.0
Component: Keywords: has-patch


The function "bp_core_time_since" returns '-1 years, 12 months' when $older_date is future from the current time.

This output is ugly. I suggest using "0" or "Future" for this cases.

$since = $newer_date - $older_date;
if ( $since < 0 ) {
    $output = '0 ' . __( 'seconds', 'buddypress' );
    return $output;

This situation happens as below:
If the settings of time zone of the server and Wordpress is not matched, the registration date of a user is recored as future (ex: Server uses GMT, WordPress uses JST, nine hours diferrences will occur)

Change History (2)

#1 @apeatling
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [1413]) Added message to tell admins to adjust their WordPress time zone to match their server time zone. Fixes "-1 year" time since problem. Fixes #692

#2 @(none)
15 years ago

  • Milestone Core 1.0 deleted

Milestone Core 1.0 deleted

Note: See TracTickets for help on using tickets.