how do i change the time zone settings

hey guys. i kinda new to elgg, my site is showing blank page. i have contacted my webhost and they said the problem is from the timezone settings. please i do like to know how to go about this. thanks

  • timezone settings shouldn't result in a blank page...

    But here's how you can set a default timezone for the site:

    engine/settings.php - put this at the top

    date_default_timezone_set('America/Vancouver');

    Just use whatever timezone id you want http://php.net/manual/en/timezones.php

  • They do actually. PHP emits errors before headers are set, so the script halts. I have seen that happen before. I think I even opened a ticket to say we need to set timezone settings at least in the installer before .htaccess is created. This is more of a shared hosting problem where php.ini is guarded like a treasure.

  • @Ismayil Kharedinov, php.ini is definitely guarded like a treasure in shared hosting, but the interesting part is that PHP first checks for a php.ini file in the root directory of the website and if that file is not available there, then it goes to the global php.ini file.

    @emegr, To edit the timezone using php.ini, create a php.ini file where the elgg is hosted and add the following line to the file:

    date.timezone = "Asia/Kolkata"
  • If you can't modify the server's php.ini, you can define the timezone in engine/settings.php as @Matt mentioned. Or you can define the timezone in Elgg's .htaccess file simply by adding the definition within the mod_php5.c where the other php variables are already set. Just add a line in the form

    php_value date.timezone 'UTC'

    within this block. Of course, you need to select one of the valid timezones (http://php.net/manual/en/timezones.php).