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 Zone Incorrect

edited January 2010 in Vanilla 2.0 - 2.8
For some reason every post has a time that is two hours ahead of the actual time. I've checked mysql's/the servers time and they are correct. I can't find a timezone setting in the dashboard, so I don't know why it would be doing this.

Comments

  • Try clearing your cookies and logging in again.

    It calculates timezone at login. I've seen others with similar intermittent problems though I've never found the cause.
  • Any updates on this? Is there a time zone var somewhere? How are the post times calculated?
  • Like I said, it figures out your timezone at login and uses that info to display post times. As for the bug, I don't think anyone has pinpointed a cause or been able to reproduce.
  • Thanks Lincoln. Maybe you could help me narrow down this problem.

    My server is in the states but I'm based in Ireland. Using Vanilla 2 and I've just noticed something. When I'm logged in my posts show the correct time in my part of the world... but when I log out they show a post time of minus six hours. The system time on my server is set to my time and shows me my local time. Can see this in webmin etc. I've also uploaded this php script to check it's output... <?php echo date('Y-m-d H:i:s'); ?> ... and it also gives me the correct local time. However when I check the DateInserted field in the GDN_Comment table it is six hours behind the local time. So I guess is either the problem lies with MYSQL or a piece of Vanilla code, possible in connection with the en-CA locale. As far as I know MYSQL inherits the system time of the server...
    Any ideas on what I should check?

    Thanks in advance for your help.
  • Okay I fixed my problem anyway... turns out is was hiding in the bootstrap.php file.

    // Make sure a default time zone is set
    if (ini_get('date.timezone') == '')
    date_default_timezone_set('Canada/Saskatchewan');

    changed to

    // Make sure a default time zone is set
    if (ini_get('date.timezone') == '')
    date_default_timezone_set('GMT');

    You could of course make sure the date.timezone is explicitly set in your php.ini file.

    Hope this helps someone else.

    Derek.
  • Well done! Saskatachewan time indeed, haha. Bookmarking this one for future reference.
Sign In or Register to comment.