• BuddyPress
  • Created On ,
  • Most Recent By momsnet,

Activity Time display is off by 5 hours

In the Activity area - it is off by 5 hours. So, let's say someone signed up as a member 4 minutes ago, it will say 5 hrs and 4 minutes ago. So it looks like there is never any real "current" activity.

I double checked to make sure the time is set right in WordPress and it is. Is there somewhere else to check?

    JoseffB

    I think I ran into this before and it was settled by changing the wp time then changing it again to my proper DST.

    momsnet
    • 90
    • #1152

    I've tried changing the times a few different times in WP and that doesn't do anything. No matter what I change the time to in WP - the buddypress activity still shows it at always 5 hours off.

    momsnet
    • 90
    • #1152

    Is anyone else having these issues? I'm not feeling really comfortable changing coding and not knowing what else it could possibly break.

    drmike

    Just curious. Have you looked at the server's time?

    momsnet
    • 90
    • #1152

    drmike - yes. That was one of the first things I did and the time is correct.

    JoseffB

    The Server time or the Time setup in the WP settings panel (or both). Technically you can have one wrong and the other right in either direction.

    momsnet
    • 90
    • #1152

    They are both right. Double checked with my server admin - after I made sure that my WP time is correct.

    And to verify the server time was right even after asking.. all our log files/stats have and show the right times. All my other scripts that I'm using on this server on our other sites are fine for the time.

    Regarding WP being set right - I have double checked numerous times, and my posts show the correct time when I make a post - so that is right.

    Any other ideas or am I totally missing something here?

    momsnet
    • 90
    • #1152

    Thanks - Trying not to be totally dense here.

    I have looked at at http://trac.buddypress.org/ticket/2713 and cannot even find where those lines are in my bp-activity.php

    Joseff: I followed your link
    http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/12-6-upgrade-date-offset/ and there seem to be 2 ways to possibly fix - one where it talks about bp_format_time I am not sure what php file that is even in.

    Do you remember exactly what you did as far as modifying. I'm afraid that I"ll totally mess things up by just guessing.

    JoseffB

    i modified the theme to add the time delta. it's a dirty trick but it worked. your db will still have the entry wrong so activity and such might still be offset.

    You could hack your card BP files but this IS NOT a good idea.bp_format_time is located in * /bp-core/bp-core-templatetags.php -> line 835

    and reads as follows:

    835 function bp_format_time( $time, $just_date = false ) {
    836 if ( !$time )
    837 return false;
    838
    839 // Get GMT offset from root blog
    840 $root_blog_offset = get_blog_option( BP_ROOT_BLOG, 'gmt_offset' );
    841
    842 // Calculate offset time
    843 $time_offset = $time + ( $root_blog_offset * 3600 );
    844
    845 // Current date (January 1, 2010)
    846 $date = date_i18n( get_option( 'date_format' ), $time_offset );
    847
    848 // Should we show the time also?
    849 if ( !$just_date ) {
    850 // Current time (9:50pm)
    851 $time = date_i18n( ' g:ia', $time_offset );
    852
    853 // Return string formatted with date and time
    854 $date = sprintf( __( '%1$s at %2$s', 'buddypress' ), $date, $time );
    855 }
    856
    857 return apply_filters( 'bp_format_time', $date );
    858 }

    JoseffB

    @momsnet what time zone are you in? +5 GMT? if so then it looks like your bp is outputting the GMT time instead of your local time.

    You can AIM me if you want: joseffbzd. Just see if I'm around.

    momsnet
    • 90
    • #1152

    JoseffB - our UTC time is -6 - I'm central time zone here.

    I'm a bit nervous about trying to alter/hack those BP files. With my luck I'd tank the script! :-)

    Would have hoped there would be a simple fix.... Since I'm new to WPMU & BuddyPress... is this common that there are many bugs within BP ?

    JoseffB

    Here's silly question how about offsetting the time to match UTC (or +6)? does that fix the problem? LOL

    momsnet
    • 90
    • #1152

    :-) Tried that ... to no avail

    JoseffB

    @momsnet when you have a change email (name at gmail) or IM me and we can have a look see. Thanks!

    momsnet
    • 90
    • #1152

    JoseffB - thanks. Have looked for you today on IM - will keep looking :-) Was gone most of yesterday.

    JoseffB

    @momsnet I'll be around today. ;) btw gmail is joseffb78 ... I always forget that LOL.

    momsnet
    • 90
    • #1152

    JoseffB is my hero today!!!! Thanks for all the time you spent with me to make a temporary fix. You ROCK!

    momsnet
    • 90
    • #1152

    So... JoseffB - guess what... that 5 hours off is still showing.. anything that is actually attached to the blogs.. such as a post or comment - THOSE times are still showing in the Activity area as 5 hours off. If you do something directly IN the activity area.. like we were yesterday posting "test".. those show the right time. But still when a member joins, or anything else done in the site is 5 hours off in the Activity Time