Change Local Timezone In .htaccess

Here’s an easy solution to change the local timezone of your account in a Linux server.

Please check if PHP is recompiled as an apache module. You can check this by creating a php file with this code:

If the server API is CGI, you can’t use this solution. If the server API is apache, add this code to your .htaccess file:

php_value date.timezone "America/Detroit"

You can find your timezone in this List Of TimeZones.

To test, create a php file named time.php and put in this code:

<?php
 echo date('d-m-Y H:i:s');
?>

call the file in the browser and check if the time is correct.

This entry was posted in Site Administration. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>