Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter
Support for Vanilla Forums Cloud product

In this Discussion

Follow Us


Time and time zone configuration

edited June 2011 in Questions
This forum software is really nice, but time configuration is epicly stupid.

You just have to place default time zone changing option somewhere in settings or at least in config.php. I have tried everything I found in older discussions, but time zone and formats are always wrong.

Comments

  • yeah, my time and time zone setting are never correct.
  • my time zone is a whole day behind, so users think all my posts are old duff - how do i change this please? this is a very necessary part of the forum that needs the option to be able to change its settings, dont you agree?
  • lucluc ✭✭
    It uses php timezone to set it's time, if it doesn't exist, it uses Canada timezone. That's the time used to store in the database.

    It also uses javascript (and a database cache per user) at login time, to determine which is the time difference and display the time correctly.

    There was some modification for the yet to be released 2.0.18 to make it better.

    So, the thing to do is to set your timezone correctly for your php installation.
  • how to change the format? i want to have dd-mm-yyyy, any suggestion?
  • shozen1shozen1 New
    edited August 2011
    thank you for your reply luc but you dont say how or where to access php timezone, also where is the javascript you mention located?

    What must one do to it in order to get accurate post times, which in my case are 1 day behind. thank you for your help.
  • lucluc ✭✭
    edited August 2011
    php, it depends on your installation. some php.ini file. (some more info there: http://www.w3schools.com/php/php_ref_date.asp)
    js, seems to be in js/global.js

    The commit "Some fixes for timezone issues.":
    https://github.com/vanillaforums/Garden/commit/d1cc08a5f991229d5e441a86fc3ae6921a85b475
  • lucluc ✭✭
    @hrrmnn: It was configurable by the config file, but the default doesn't seem to be in config-defaults.php anymore. It uses strftime format, so basically you could do whatever you want.
  • shozen1shozen1 New
    edited August 2011
    @luc i am left confused with all this, still dont know what to do... you say 'some' php.ini file but where is it exactly?
  • lucluc ✭✭
    It depends on how the server was setup, so I can't say more than that.
    On debian, it's /etc/php5/apache/php.ini if using mod_php with apache.
    Mine is /etc/php5/cgi/php.ini, as using a fast-cgi process.
  • shozen1shozen1 New
    edited August 2011
    @luc

    https://github.com/vanillaforums/Garden/commit/d1cc08a5f991229d5e441a86fc3ae6921a85b475

    The following 3 files from github were copied to my server with no change to the time zone. We are still almost a whole day behind on the server. Please I beg you -anyone who can help with this, I really need to get this fixed, its driving me crazy.

    applications/dashboard/controllers/class.utilitycontroller.php
    applications/vanilla/controllers/class.categoriescontroller.php
    js/global.js
  • shozen1shozen1 New
    edited August 2011
    I finally fixed this problem today. Here's what to do:

    Create a php.ini file (which must be done in cpanel) and then edit the time zone value: date.timezone = "Europe/London" ; put your timezone in the quotes.

    The php.ini file will be created in your public_html folder so you need to transfer the file to the root folder of your vanilla install - unless you want to change the time zone for all your sites.

    And your done.
  • I had to import an old PHPBB3 forum, and I had the problem with dates/times described here.

    I was not allowed to change php.ini globally, and a local PHP file did not work out for me.

    The hack that did this, was:

    1. in "index.php" of your vanilla installation add these lines after line 19:

    ini_set('date.timezone', 'Your/Timezone');
    date_default_timezone_set("Your/Timezone");

    2. in vanilla2export.php add the same lines as above after line 31

    3. Export the data from the old forum

    4. Import the data in your Vanilla installation.

    This simple procedure got me the right times displayed in the forum.

    As @luc mentioned, I'm looking forward to Vanilla 2.0.18 :o)
    onisac
Sign In or Register to comment.