GuppY Help Center, help online, documentation and tutorials

telecharger.png

You are here :   Welcome » How to set my website to right time zone if my server is abroad.
    Print this page...

How to set my website to right time zone if my server is abroad.

Open the file inc/functions.php.
Search for the following code lines :

function GetCurrentDateTime() {
$­­­dateout = date("YmdHi");
return $­­­dateout;
}

For version V4.6.12, it's somewhere about line 558.
Then replace those lines with the following code:

function GetCurrentDateTime() {
$­­­hourdiff = "0";
$­­­timeadjust = ($­­­hourdiff * 60 * 60);
$­­­dateout = date("YmdHi",time() + $­­­timeadjust);
return $­­­dateout;
}

$­­­hourdiff is the time between your web server time and the time of the country you live.
You need to use the sign + or - plus hours between the web server time and your country time.
Like this : hourdiff = "+9"
 
    


 

   

In PHP 5
Line 84 of file inc / includes.inc initializes the reference time zone. By default, it initializes GuppY at the time of Paris.

date_default_timezone_set('Europe/Paris');


So just
replace "Europe / Paris" by the correct time zone e.g. "America / Montreal" to find such http://www.php.net/manual/en/timezones.php



Note: this FAQ is obsolete since version 4.6.18 which allows changing timezone from admin.

 


Creation date : 15/02/2005 @ 18:49
Category : FAQ GuppY <= 4.6.xx - Webhosting services issues
Page read 15676 times