Skip to:
Content
Pages
Categories
Search
Top
Bottom

The time zone is off by 7 hours in my bbpress plugin forums


  • ebharding
    Participant

    @ebharding

    When I post to my forum, the timestamp on the post are 7 hours in the past, wordpress has the correct timezone with is us pacific time.

    I don’ t see anywhere I can set timezone in bbpress

Viewing 21 replies - 1 through 21 (of 21 total)

  • Gautam Gupta
    Participant

    @gautamgupta

    The bbPress plugin should use the WordPress timezone. Can you post a link to your forums or any other additional details?


    ebharding
    Participant

    @ebharding

    the forums are on non public site.

    When I post, the time stamp is correct, but the Freshness time for the post says 7 hours.

    thanks


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    Sounds like a GMT issue. Will look into it.


    ebharding
    Participant

    @ebharding

    Any progress on this?

    Here is a screen shot of the dashboard showing the issue.

    my timezone is “Pacific” and that is set in the wordpress settings.

    system clock says 12:21,

    post time stamp is 12:06 and

    the freshness say 7 hours ago.

    http://www.westsac.com/bbpress_timezone_bug.png.

    The forums are going live next week and I am in the process of removing the “Freshness” code from the public views.


    spaghetti
    Member

    @spaghetti

    Why would you remove the “Freshness” code from public views by the way?


    ebharding
    Participant

    @ebharding

    Because the information it was displaying was wrong.


    ebharding
    Participant

    @ebharding

    discovered something interesting

    I have http://www.westsac.com and http://www.westsac.com/news-ledger. This is a Multisite installation. the BBPress forum are activated on both (network activated) site but we are only using them on the main site

    http://www.westsac.com/forums/ here the freshness is off by -7 hours on the other site

    http://www.westsac.com/news-ledger/forums/forum/top-level/ the freshness is correct.

    I scanned the options table of both sites and discovered that the got_offest was different, main site was set to -7 the other site was blank.

    So I change the gmt_offset to blank on the main site, but that did not make a difference.

    Does something have to happen for this change to take effect?

    AFAIK when posts (or pages, forums, topics or replies) were saved on specific timezone, and the you change to another timezone your post date won’t be changed.

    Those new timezone only affect the next posts, and your previous post will have same post date. So when you visit your forum, it still showing old date.


    ebharding
    Participant

    @ebharding

    Yes, I know, new posts still have the wrong timezone


    woodwardmatt
    Member

    @woodwardmatt

    @ebharding – I spotted the same issue also. The site I have been working on is currently using an offset of +9.5hrs so the “Freshness” column is always incorrect. The diff function for “Freshness” must not be taking the GMT offset into account.


    ebharding
    Participant

    @ebharding

    I fixed the problem by adding the diff back in. Interesting that it only happens to some sites.


    woodwardmatt
    Member

    @woodwardmatt

    Ahh ok, do you remember any specifics (e.g. files used / changed) – I’ve only really analysed at a high-level so far.

    @JJJ – Has this issue had any air time as yet?


    ebharding
    Participant

    @ebharding

    This was my solution

    I edited line 178 in my /wp-content/plugins/bbpress/bbp-includes/bbp-common-functions.php

    function bbp_get_time_since( $time ) {

    return apply_filters( ‘bbp_get_time_since’, human_time_diff( $time – 25200, current_time( ‘timestamp’ ) ), $time );

    }

    In my case (Pacific Time) I needed to subtract 7 hours which translated to 25200 seconds.


    karlwithak23
    Member

    @karlwithak23

    @ebharding – Thanks so much for posting that. I was going nuts trying to get this issue fixed. Seems like kind of an odd bug – hopefully something that will be fixed in the next update.


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    @ebharding – Rather than hardcode the time difference, can you change:

    function bbp_convert_date( $time, $d = 'U', $translate = false ) {

    to

    function bbp_convert_date( $time, $d = 'G', $translate = false ) {

    and report back results?


    ebharding
    Participant

    @ebharding

    I made the suggested change and that seemed to fix the problem.

    thanks!


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    Can you confirm that no other timestamps are adversely affected? That function is used rather extensively through-out bbPress, so it’s possible it might skew the math of other times in the other direction.


    ebharding
    Participant

    @ebharding

    There is not a lot of traffic on the forum yet, but it would appear that everything is ok.

    @johnjamesjacoby … Hello,

    I did

    function bbp_convert_date( $time, $d = ‘U’, $translate = false ) {

    to

    function bbp_convert_date( $time, $d = ‘G’, $translate = false ) {

    but I see no change.

    I’m on PST timezone..

    thanks!

    @johnjamesjacoby

    in this file::

    my /wp-content/plugins/bbpress/bbp-includes/bbp-common-functions.php

    thanks for your help!


    lswhere
    Participant

    @lswhere

    *** FIXED***(kind of)*** I know it’s been 8 years since this was active but I’ve been banging my head for DAYS trying to figure this out and HERE’S THE FIX!!!

    Download the plugin BBP Style Pack https://wordpress.org/plugins/bbp-style-pack/ after activation go into style pack settings open the “Freshness Display” tab – check the ‘activate freshness display’ box and then change the freshness format from default to display the date on the last post. Save changes and that’s it. If you leave the setting on default it will not work. You will have the same problems. It needs to be changed to ‘show date of last post.

    I HOPE YOU CAN RELAX NOW

Viewing 21 replies - 1 through 21 (of 21 total)
  • You must be logged in to reply to this topic.
Skip to toolbar