Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

7 Hours Ago

edited September 2007 in Vanilla 1.0 Help
It might be me, but...

Users who are currently logged on show their last activity was "7 Hours Ago." This time stamp remains until 7 hours after log off, then the time begins to count properly. The time appears in a search for users and on the users' member page.

Is this a Vanilla issue or something strange going on in my installation? Thanks!

Comments

  • Options
    Are you GMT-7 by any chance? Or perhaps somewhere that would result in some sort of 7 hour time difference. Maybe 7 hours away from your server?
  • Options
    I'm in California, Pacific time so that's GMT -8. This effect is being reported by users from all over the country and in England, so it is coming from my installation. I will try to disable everything except Who's Online and see if it's an incompatibility issue with something else.
  • Options
    Just tried it. With only Who's Online active, and only me just logged in, I show last activity as "7 hours ago."
  • Options
    edited September 2007
    Do comments also show this weird time handling? Both comments and profile dates are apparently handled the same way.

    PHP 5 by any chance? What versions of MySql and Vanilla?

    Another thing to try is go into themes/account_profile.php, and change line 45 to look like this:<p>'.TimeDiff($this->Context, $this->User->DateLastActive).'</p> (removed , mktime())
  • Options
    Time stamps in comments are handled properly. MySQL is 4.1.2l and Vanilla 1.1.2. I'll try your php mod and see what happens.
  • Options
    edited September 2007
    No joy. I replaced the lines with mktime with the one above and it had no impact.
  • Options
    edited September 2007
    OK, try adding something like this inside conf/settings.php, for PHP 5+:date_default_timezone_set('America/Chicago');
    And for PHP versions less than five, use:putenv('TZ=CST');
    If nothing is different, try 'America/Los_Angeles' or 'TZ=PST' respectively, and see if that makes any difference to the numbers.

    As far as I can tell, Vanilla is pretty consistent at handling dates in unix timestamp format, while MySql gets them in it's expanded format. Setting different timezones in PHP changes the conversion from MySql's date to the unix timestamp format--which is always based on the GMT time zone.
  • Options
    I tried adding putenv('TZ=PST'); and it made no difference. My PHP is version 4.1 as well.

    It is interesting that the only times that are wrong are user visit times. Everything else, such as when a comment is added, it correct. It does this with just Vanilla running and no other extensions.
  • Options
    Some weird php.ini/server setting having to do with sessions?
This discussion has been closed.