Add to Favourites    Print this Article

Change Time Zone

How can I change the time zone?

Live Sites Hosting servers have been set up with the GMT Time Zone. You can modify your scripts to use EST (Eastern Standard Time) or any other timezone you need by the following methods :

1) Using the function "putenv" in php scripts :

To convert Time Zone using putenv

<?
echo "Original Time: ". date("h:i:s")."\n";putenv("TZ=US/Eastern");
echo "New Time: ". date("h:i:s")."\n";
?>

For Central Canada use:

<?
echo "Original Time: ". date("h:i:s")."\n";putenv("TZ=US/Central");
echo "New Time: ". date("h:i:s")."\n";
?>

==============================================


2) By putting the following in the .htaccess file in your main public_html folder :


SetEnv TZ "US/Pacific" # Use for Western Canada or "GMT-8" instead of "US/Pacific"


You can use 1st OR 2nd method however in case your choice is 2nd - all php data/time functions will use timezone in .htaccess.

Also you should use "US/Central" or "GMT-6", this is identical

Below is a list of timezones and the offset (in hours) from UTC (Universal Coordinated Time). Find your geographic area on the list to determine your offset.

UTC Offset Geographic Area
0 England, Ireland, Portugal
+1 Europe: France, Spain, Germany, Poland, etc.
+2 Central Europe: Turkey, Greece, Finland, etc.
+3 Moscow, Saudi Arabia
+4 Oman
+5 Pakistan
+6 India
+7 Indonesia
+8 China, Phillipines, Malaysia, West Australia
+9 Japan
+10 East Australia
+11 Solomon islands, Micronesia
+12 Marshall Islands, Fiji
-11 Samoa, Midway
-10 Hawaii, French Polynesia, Cook island
-9 Alaska
-8 US Pacific, Canada British Columbia
-7 US Mountain, Canada Alberta
-6 US Central, Canada Ontario
-5 US Eastern, Canada Nova Scotia
-4 New Foundland, Venezuela, Chile
-3 Brazil, Argentina, Greenland
-2 Mid-Atlantic
-1 Azores, Cape Verda Is.



Was this answer helpful?

Also Read




Powered by WHMCompleteSolution