Menu Close

How to Set Your Website Timezone by htacess file

Normally your server timezone is set to its local timezone. But as a webmaster, you can set your website timezone by date.timezone directive in htaccess file.  To find your website timezone, you can create an info.php file and upload to your root directory:

<?php phpinfo(); ?>

You can easily find your server’s timezone.

To set your web servers date timezone, for example for Eastern Standard Time (EST) use the following code:

SetEnv TZ America/Indianapolis

For example, for Los Angeles time (Pacific time), use the following code:

SetEnv TZ America/Los_Angeles

Other location examples include:

America/New_York - Eastern Time
America/Detroit - Eastern Time - Michigan (most locations)
America/Louisville - Eastern Time (Louisville, Kentucky)
America/Indianapolis - Eastern Standard Time (Indiana, most locations)
America/Indiana/Marengo - Eastern Standard Time (Indiana, Crawford County)
America/Indiana/Knox - Eastern Standard Time (Indiana, Starke County)
America/Indiana/Vevay - Eastern Standard Time (Indiana, Switzerland County)
America/Chicago - Central Time
America/Menominee - Central Time (Michigan, Wisconsin border)
America/Denver - Mountain Time
America/Boise - Mountain Time (South Idaho, East Oregon)
America/Shiprock - Mountain Time (Navajo)
America/Phoenix - Mountain Standard Time (Arizona)
America/Los_Angeles - Pacific Time
America/Anchorage - Alaska Time
America/Juneau - Alaska Time (Alaska panhandle)
America/Yakutat - Alaska Time (Alaska panhandle neck)
America/Nome - Alaska Time (west Alaska)
America/Adak - Aleutian Islands
Pacific/Honolulu - Hawaii

After you have created your .htaccess file, you can check your info.php file to verify whether your website timezone is changed.

 

Related Posts