Difference between revisions of "Changing Timezone"

From WHMCS Documentation

Line 1: Line 1:
If you need your WHMCS system to operate in a different timezone to that which your server is configured with, you can do this by simply adding the line below to your WHMCS '''configuration.php''' file:
+
The time under which your WHMCS installation will run is based upon the server clock and the timezone setting in your PHP configuration. Therefore to change the time displayed in WHMCS there are two options:
  
date_default_timezone_set('Europe/London');
+
#Change the server clock directly
 +
#Edit the PHP configuration specifying a different timezone.
  
This changes the timezone for the WHMCS installation to the locality you specify so you just need to replace the 'Europe/London' part with the location you are based in.
+
Changing the server clock may not be desirable if clients are hosted on the server and would require root access, so option 2 is the most viable for the majority  of users. A number of hosting providers allow the PHP configuration to be changed on an individual directory by creating a php.ini file within the WHMCS directory. In that situation the following line could be added:
 +
 
 +
<source lang="php">
 +
date.timezone=Europe/London
 +
</source>
  
 
For a full list of the available timezone localities you can use, please refer to http://www.php.net/manual/en/timezones.php
 
For a full list of the available timezone localities you can use, please refer to http://www.php.net/manual/en/timezones.php
  
'''Note: This should be entered above the last line, ?>, in your configuration.php file
+
Please contact your hosting provider/server admin if you are unsure how to customise the PHP configuration of your server.
'''
 

Revision as of 18:01, 25 August 2014

The time under which your WHMCS installation will run is based upon the server clock and the timezone setting in your PHP configuration. Therefore to change the time displayed in WHMCS there are two options:

  1. Change the server clock directly
  2. Edit the PHP configuration specifying a different timezone.

Changing the server clock may not be desirable if clients are hosted on the server and would require root access, so option 2 is the most viable for the majority of users. A number of hosting providers allow the PHP configuration to be changed on an individual directory by creating a php.ini file within the WHMCS directory. In that situation the following line could be added:

date.timezone=Europe/London

For a full list of the available timezone localities you can use, please refer to http://www.php.net/manual/en/timezones.php

Please contact your hosting provider/server admin if you are unsure how to customise the PHP configuration of your server.