How do I offset the Timezone for my location, instead of the server timezone?

First of all, setting the timezone at .htaccess level using “SetEnv TZ location” doesn’t work on your php script.

If you are using PHP 5.1 and ealier, add this code within your php

putenv(’TZ=Europe/London’);   /* change the TZ value accordingly. */

If you are using PHP 5.1 up, add this code within your php script.


date_default_timezone_set(’Europe/London’);

About author : This original article is property of Top 10 Web Hosting (http://www.top10webhosting.com). List of best web hosting services company offering PHP and MySQL. Compare & save ! on web hosting fee.

Note : Please include author information if you wish to republish this article.