Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Time Stamp is 5 Hours Ahead (GMT) only In Comments not Discussions Page

us3rus3r New
edited November 2015 in Vanilla 2.0 - 2.8

I have a strange issue with time zones. The time is correct when I log in (EST) and when logged out (EST) on the discussions page. However, the time is 5 hours ahead when viewing the comments in a discussion, when logged out. The time is accurate when viewing the discussions page (index) when logged out.

The issue is when viewing the comments in a discussion when not logged in. It's in GMT while the time in the discussions page is in EST.

I've changed the the guest time in config.php to
$Configuration['Garden']['GuestTimeZone'] = 'America/Toronto';

bootstrap.php is 'UTC'

php.ini is

[Date]
; Defines the default timezone used by the date functions
; http://www.php.net/manual/en/datetime.configuration.php

ini.date.timezone;

date.timezone = "America/Toronto"

Thanks for your help +1:

Comments

  • Version 2.1.12p2

  • jackmaessenjackmaessen ✭✭✭
    edited November 2015

    Hmmm...you are right...i have the same issue with 1 hour difference as well on 2.1 version as on 2.2 version. Even on this forum there is a time difference when being logged in or out. See your own comment above what is posted at 10.55 AM when logged in and 9.55 AM when logged out

  • Yes, I see it too. So there's no fix for this? What about changing the HourOffset? Thanks.

  • I assume this cannot be resolved?

  • I really have no idea what we're talking about here. Are you sure it's not just the page being cached by your browser? Timezones are working correctly for me as far as I can tell.

  • us3rus3r New
    edited November 2015

    When not signed in, the time in the comments is 5 hours ahead (GMT). The time is correct (EST) when viewed from the discussion (index) page.

    Recent discussions page/Index page
    domain.com

    domain.com/discussion/blah-blah-blah

    • Guests will always see timestamps in the timezone defined in $Configuration['Garden']['GuestTimeZone']. You can check if it is working by changing it to a different timezone.
    • If you are logged in, you will see all timestamps in the timezone your computer clock is in. If it is not working, check for JS errors in your browser console.
    • If you have changed the timezone in bootstrap.php in the past, all times will be wrong and can only be corrected by changing them in the database.
    1. $Configuration['Garden']['GuestTimeZone'] = 'America/Toronto';
    2. Timezones are fine when logged in
    3. bootstrap.php is 'UTC' . Though, I did change it to 'EST' or 'America/Toronto' for a few minutes to see if it would work. It's been 'UTC' since then.

    I changed the database time a few days ago.

  • us3rus3r New
    edited November 2015

    I still have not solved this issue. I've done the necessary changes but the time is still GMT when not signed in. I need it to be EST (Toronto/Montreal/New York) when guests visit the site.

    1. $Configuration['Garden']['GuestTimeZone'] = 'America/Toronto';
    2. Timezones are fine when logged in
    3. bootstrap.php is 'UTC' . Though, I did change it to 'EST' or 'America/Toronto' for a few minutes to see if it would work. It's been 'UTC' since then.

    Once again, the time is only 5 hours when the comments in the discussions are viewed. The time is correct when viewing the last comment time in the recent discussions/index page.

    This is the only issue remaining in my forum. Help is greatly appreciated. Thanks.

  • Have you tried setting your configuration to another timezone?

    Where are you setting the configuration?

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Yes, and the guest time zone is still in GMT.
    $Configuration['Garden']['GuestTimeZone'] = 'America/Toronto'; in config.php file

  • Hm...

    $Configuration['Garden']['GuestTimeZone'] = 'America/Toronto';
    

    This worked for me. You might have found a bug in 2.1.12p2.

    Try updating to 2.2 and see if that fixes your issue.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Hm...it looks like it's the theme I'm using. I changed the mobile theme and the time is accurate when viewing as guest.

Sign In or Register to comment.