Skip to:
Content

BuddyPress.org

Opened 15 years ago

Closed 15 years ago

Last modified 3 years ago

#1641 closed defect (bug) (fixed)

Activity Appears 6 Hours Behind

Reported by: developdaly's profile developdaly Owned by:
Milestone: 1.2 Priority: major
Severity: Version:
Component: Keywords:
Cc: email@…, developdaly, windhamdavid

Description

New activity (i.e. friend acceptance, public message, blog post) is listed as appearing as if it happened 6 hours earlier than it really did.

However, on the user's profile it displays the correct time. So the activity in general is correct, but specific actions are incorrect.

Settings > General > Timezone
It doesn't matter how I set my timezone; the time is always off by 6 hours.

My timezone in CST or GMT -6. My server time is correct.

WPMU 2.9.1.1
BP 1.2-rare

Attachments (1)

time.jpg (101.8 KB) - added by developdaly 15 years ago.
Timestamps

Download all attachments as: .zip

Change History (27)

#1 @developdaly
15 years ago

  • Milestone changed from 1.3 to 1.2

#2 @apeatling
15 years ago

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

The timezone you set needs to match your server time. If there is a difference, it will result in this problem.

#3 @developdaly
15 years ago

  • Resolution worksforme deleted
  • Status changed from closed to reopened

My server is UTC-6 and setting WP to UTC-6 (or Chicago) results in the 6 hour difference.

If I change WP to UTC-12 then the activity times are perfect, but my blog post times are wrong.

#4 @21cdb
15 years ago

  • Cc email@… added

#5 @apeatling
15 years ago

I need steps to reproduce this, I can't make it happen on any of my installs.

First of all, try the latest trunk. Which activities are incorrect, is it all of them or just specific ones?

@developdaly
15 years ago

Timestamps

#6 @developdaly
15 years ago

  • Cc developdaly added

Well it turns out I was wrong about my server time, but using the same time zone as it doesn't help anyway.

I've attached an image of screenshots that might help.

I've set my WordPress timezone to UTC-6 (my timezone).

I published a post and the database and frontend both display {2010-01-22 08:56:15}. Note that wp_posts_1 has a post_date_gmt field that reads 2010-01-22 14:56:15.

I updated my wire and the database date_record field says 2010-01-22 08:55:06 but the Activity page says "Patrick Daly posted an update: 6 hours, 1 minute ago".

I'm not sure how to reproduce this though. Its been happening since a fresh install and I'm updating from trunk every few days.

All activities are off by 6 hours, except the "active user" status (i.e. Patrick Daly: active 0 seconds ago".

#7 @developdaly
15 years ago

  • Keywords bp_core_time_since added

andrea_r's take: http://buddypress.org/forums/topic/activity-stream-not-working/page/2#post-34379

Issues seem to be with bp_core_time_since() and runs gmdate().

#8 @apeatling
15 years ago

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

(In [2416]) Fixes #1641

#9 @developdaly
15 years ago

  • Keywords bp_core_time_since removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

Updated to latest revision [2430] and I still have the same problem. Can anyone else confirm?

#10 @developdaly
15 years ago

A bit of a correction and more clarification...
The activity feed is now showing correct times for new members and new friend connections.

However, new blog posts and messages are now showing as "40 years and one month ago".

#11 @apeatling
15 years ago

What about new updates?

#12 @apeatling
15 years ago

  • Resolution set to worksforme
  • Status changed from reopened to closed

This is not going to fix previous updates or anything that was wrong up to this point.

#13 @developdaly
15 years ago

  • Resolution worksforme deleted
  • Status changed from closed to reopened

Sorry, I should have been more specific. I was referring to new events -- I figured old activity timestamps wouldn't be affected.

#14 @developdaly
15 years ago

Great example of the bug:

In a group forum, a topic has a "Freshness" cell. I can create a new topic and even reply to that topic with a successful 'time ago' (i.e. 10 seconds ago).

However, that very same forum topic shows up in the activity stream as "40 years, one month ago".

So the bp_the_topic_time_since_last_post function seems to working fine, but bp_core_get_last_activity may not be.

#15 @apeatling
15 years ago

It looks as though this is only a problem in PHP4, in PHP5 it works with no issues. I'm tracking down the cause.

#16 @apeatling
15 years ago

Looks like strtotime() is calculating the timestamp for "2010-01-25 14:53:43 GMT" formatted dates differently in PHP4 than PHP5, causing the problem.

#17 @apeatling
15 years ago

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

(In [2451]) There's nothing I like better than spending an afternoon weaving my way around inconsistencies between PHP4 and PHP5 date/time handling. Fixes #1641

#18 @developdaly
15 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

We're gettin' closer. Instead of "40 years, 1 month ago" now I'm seeing "10 years, 1 month ago" on new activity.

At least that's within my lifetime ;)

#19 @windhamdavid
15 years ago

  • Cc windhamdavid added

unfortunately, I can duplicate developdaly's error with PHP4 I'm simply getting (sometime ago)
PHP5 appears to handle it fine with Apch 2/1.2, Ubu, CentOS, RHEL,

#20 @windhamdavid
15 years ago

I'm sorry, hold that thought.. I mighta missed http://trac.buddypress.org/changeset/2451 on that server.

#21 @windhamdavid
15 years ago

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

Correction - I dbl chked under several server conditions in PHP 4 and 5 - both are working for me with revision 2454

#22 @developdaly
15 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

PHP 5.2.8
Apache/2.2.11

Even after [2451] I'm still having issues.

#23 @windhamdavid
15 years ago

i'm not going to close the ticket again, but perhaps you have a server configuration issue? I tested pretty extensively.... did you setup your apache config? what is the IP address of your site?

#24 @windhamdavid
15 years ago

Patrick, I ran a scanner on your server.. don't mind your logs. Please be a bit more specific than I'm still having issues. I've run the code outside of bp for testing and it holds ups under 4/5 in various server configs? Can you point me to where this is happening?

#25 @windhamdavid
15 years ago

the only place i see it is here - http://gscouts.com/ please advise?

#26 @developdaly
15 years ago

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

I've updated to [2454] and I'm not having issues anymore. Not sure if something since [2451] fixed it or the files didn't overwrite properly.

So if it's working for everyone else I'll close. However, there may be a related issue in another ticket: #1696

By the way, the site I'm running trunk on is http://dentonmafia.com/

Note: See TracTickets for help on using tickets.