1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to fix forum time

Discussion in 'Troubleshooting and Problems' started by strongarm_playa, Jun 9, 2012.

  1. strongarm_playa

    strongarm_playa Active Member

    I have my forum time set for Eastern Standard time, but for some odd reason, all posts, comments and status' are showing a different time. I have looked into this and still yet I can not seem to find a solution. Any help would be greatly appreciated. Thanks.
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    The forum time will be affected by the server time.

    If your timezone etc. is correct then the server time will be wrong. You may need your hosts to alter this.
     
  3. strongarm_playa

    strongarm_playa Active Member

    ok. Thanks
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    To debug the server time you could add this to your PAGE_CONTAINER template near the top.

    Code:
    <xen:if is="{$visitor.is_admin}">{xen:datetime $serverTime, 'absolute'}</xen:if>
    That will display the current server time in your timezone. If it displays wrong, it's definitely a server problem.
     
    Jake Bunce likes this.
  5. strongarm_playa

    strongarm_playa Active Member

    Contacted my host on server time issue. All time is central time, but its not even displaying central time. Its way off... almost a full day off. But they gave me a php code to use but I do not know where to install this code.
     
  6. Chris D

    Chris D XenForo Developer Staff Member

    Post the code they gave you we'll try and tell you what it does and how to use it.
     
  7. strongarm_playa

    strongarm_playa Active Member

    Can I change the server clock or time zone?

    The server clock is set to Central Standard Time. You cannot change the time on a shared server's clock.
    You can change the time zone being displayed with a PHP script. (Unfortunately, I cannot tell you where to put this code. You will need to consult with the program developer.) Here are two sample codes:
    ==================================================
    <?php
    putenv("TZ=Europe/Amsterdam");
    ?>
    ==================================================
    <?php
    date_default_timezone_set("America/Los_Angeles");
    ?>
    ==================================================
    You can set the timezone in .htaccess as well. (You can create a New File and name it ".htaccess", or you can edit the existing one. The .htaccess file belongs in /public_html/ - or a subdirectory if for a subdomain or addon domain). Add the line:
    ==================================================
    SetEnv TZ America/Indianapolis
    ==================================================

    Note: I tried to make changes to the ".htaccess" file but I cant access the file
     
  8. strongarm_playa

    strongarm_playa Active Member

    I added this code, as it was recommended above and the time is 5 hrs ahead of Eastern Standard Time...

    This is annoying and im having a hard time trying to find an answer.
     
  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Just to be sure... your time zone preference is set on this page when you are logged in (it's a user preference):

    http://xenforo.com/community/account/preferences

    The code Yorick posted will show the time based on that time zone. Is it still not correct? If so then your host needs to fix the server clock.
     
    Chris D likes this.
  10. strongarm_playa

    strongarm_playa Active Member

    Yes, my timezone is set to Eastern Standard Time
     
  11. strongarm_playa

    strongarm_playa Active Member

    I found the problem. Turns out that the admin browisng preferences was NOT set to Eastern Standard Time.. Problem fixed. Sorry for the issue at hand and thanks for all the help guys
     
    Raitsa and Chris D like this.
  12. snoopy5

    snoopy5 Well-Known Member

    How can I chnage with phpmyadmin the time zone of all users after an import to continental european time (Paris)?
     
  13. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  14. kankan

    kankan Active Member

    Hi Jake
    Any way to force UTC+1 by default for the users ?
     
  15. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

Share This Page