Top10WebHosting

Open NavigationOpen Search
Everything related to web hosting.
  • Learning center
    • Move host guide
    • Compare Shared Hosting & VPS
    • SEO related
  • Hosting by features
    • Top web hosting
    • cPanel web hosting
    • PayPal web hostings
    • PHP Web Hosting
    • VPS Web Hosting
  • Coupons
    • Bluehost coupon 2017
  • Hosts overview
    • GreenGeeks Review
    • JustHost Overview.
    • Bluehost Overview
    • IXWebhosting Overview
    • Hostmonster Overview
    • Hostgator Overview.
    • SiteGround Overview
  • About
    • Contact Us
    • Disclosure
You are here: Home / apache / Setting right timezone on your PHP.

Setting right timezone on your PHP.

August 25, 2008 by Wyng

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’);

Filed Under: apache, php, tutorial

Back to top ▴

List of Most popular hosting plan


Our list of top web hosting plan with discounted entry price, good features with excellent support.

Hosts using the Most user friendly control panel


cPanel control panel has the most user friendly interface to control the Linux enviroment.

Hosts accepting PayPal


Stay safe, use Paypal to hide your credit cards from hosts.

Follow us on Social media

About Top10WebHosting.com

I manage & consult web developments for companies. And I have chance to use different web hosts by different client.

I am here to share some good & highlights of different hosts by features & rating.

Search this website

Copyright © Top10WebHosting.com 2002-2018. All Rights Reserved.

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok